Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i40evf: don't violate scope

Move a declaration up one level so we don't dereference it out of scope.
This didn't cause any panics, but the details->async field would
mysteriously disappear, causing unnecessary delays when sending AQ
commands. Also, the code is just plain wrong.

Change-ID: I753f64f13c55e5d75ea4351e29b14fb53b2f0104
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

authored by

Mitch Williams and committed by
Jeff Kirsher
4334edf5 49d7d933

+1 -1
+1 -1
drivers/net/ethernet/intel/i40evf/i40e_common.c
··· 551 551 struct i40e_asq_cmd_details *cmd_details) 552 552 { 553 553 struct i40e_aq_desc desc; 554 + struct i40e_asq_cmd_details details; 554 555 i40e_status status; 555 556 556 557 i40evf_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_send_msg_to_pf); ··· 566 565 desc.datalen = cpu_to_le16(msglen); 567 566 } 568 567 if (!cmd_details) { 569 - struct i40e_asq_cmd_details details; 570 568 memset(&details, 0, sizeof(details)); 571 569 details.async = true; 572 570 cmd_details = &details;