]> git.baikalelectronics.ru Git - kernel.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)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 23 Sep 2016 05:33:40 +0000 (22:33 -0700)
commita6a7cb5095d207cdd196a0a5ff42207baf2ae819
tree1f51a4ce7333bc82853abb4e007154cfac57c7dc
parentd405ffa1ce0c6d767a01e38e08cb000a3d43f219
i40e: avoid potential null pointer dereference when assigning len

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>
drivers/net/ethernet/intel/i40evf/i40e_common.c