]> www.infradead.org Git - users/jedix/linux-maple.git/commit
i40e: avoid potential null pointer dereference when assigning len
authorColin Ian King <colin.king@canonical.com>
Sun, 28 Aug 2016 17:41:01 +0000 (18:41 +0100)
committerDhaval Giani <dhaval.giani@oracle.com>
Wed, 8 Mar 2017 00:39:23 +0000 (19:39 -0500)
commit9adf9039192fc25bc956cfe69103d5dc6e828065
tree8bd35e64c6db52cecb80b9307ad2aeb22e78eaeb
parent381fb752b89c2b3a168e7b42ae4d1c78cf03a3e7
i40e: avoid potential null pointer dereference when assigning len

Orabug: 24568124

There is a sanitcy check for desc being null in the first line of
function i40evf_debug_aq.  However, before that, aq_desc is cast from
desc, and aq_desc is being dereferenced on the assignment of len, so
this could be a potential null pointer deference.  Fix this by moving
the initialization of len to the code block where len is being used
and hence at this point we know it is OK to dereference aq_desc.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit ff918912e1b8ba4e743d1f0b06ced1d01969e17c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/net/ethernet/intel/i40evf/i40e_common.c