In case the function parameter 'cmd_details' is false, the pointer passed
by value is locally set to point to struct 'details'. When passing pointer
'cmd_details' to i40evf_asq_send_command(), 'details' is already
out of scope.

Detected by Coverity: CID 1164857.

Signed-off-by: Christian Engelmayer <[email protected]>
---
 drivers/net/ethernet/intel/i40evf/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40e_common.c 
b/drivers/net/ethernet/intel/i40evf/i40e_common.c
index 7b13953..a20b2aa 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_common.c
@@ -179,6 +179,7 @@ i40e_status i40e_aq_send_msg_to_pf(struct i40e_hw *hw,
                                u8 *msg, u16 msglen,
                                struct i40e_asq_cmd_details *cmd_details)
 {
+       struct i40e_asq_cmd_details details;
        struct i40e_aq_desc desc;
        i40e_status status;
 
@@ -194,7 +195,6 @@ i40e_status i40e_aq_send_msg_to_pf(struct i40e_hw *hw,
                desc.datalen = cpu_to_le16(msglen);
        }
        if (!cmd_details) {
-               struct i40e_asq_cmd_details details;
                memset(&details, 0, sizeof(details));
                details.async = true;
                cmd_details = &details;
-- 
1.8.3.2

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit 
http://communities.intel.com/community/wired

Reply via email to