]> www.infradead.org Git - users/jedix/linux-maple.git/commit
e1000: avoid null pointer dereference on invalid stat type
authorColin Ian King <colin.king@canonical.com>
Fri, 22 Sep 2017 17:13:48 +0000 (18:13 +0100)
committerJack Vogel <jack.vogel@oracle.com>
Mon, 8 Jan 2018 17:48:18 +0000 (09:48 -0800)
commitd11533ba21b9b3adb412eca9e135699841bdc72b
tree9ae591277f32a1e2e0fe90eb74cec24c087fee4c
parent0f5288704a2e255e6e4f6fa7b2eb881a88f5270e
e1000: avoid null pointer dereference on invalid stat type

Currently if the stat type is invalid then data[i] is being set
either by dereferencing a null pointer p, or it is reading from
an incorrect previous location if we had a valid stat type
previously.  Fix this by skipping over the read of p on an invalid
stat type.

Detected by CoverityScan, CID#113385 ("Explicit null dereferenced")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Orabug: 27069012
(cherry picked from commit 5983587c8c5ef00d6886477544ad67d495bc5479)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Ethan Zhao <ethan.zhao@oracle.com>
drivers/net/ethernet/intel/e1000/e1000_ethtool.c