]> 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)
commitf4bca6cf3a2d1104f931870ad16fc14d5b3ac5d1
tree1f51a4ce7333bc82853abb4e007154cfac57c7dc
parent7787a0103721fd4831921f4edec2fb113a9b940e
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