]> git.baikalelectronics.ru Git - kernel.git/commit
net: marvell: fix a missing check of acpi_match_device
authorKangjie Lu <kjlu@umn.edu>
Wed, 26 Dec 2018 06:31:08 +0000 (00:31 -0600)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Dec 2018 00:26:55 +0000 (16:26 -0800)
commitf856df50519d84ccd7ed29705d7d5e8b05b89726
tree1ce96be8770583d1dfd5201552733ea6493654fc
parentafa27932e847e6463c6e28daf19965f5150cd186
net: marvell: fix a missing check of acpi_match_device

When acpi_match_device fails, its return value is NULL. Directly using
the return value without a check may result in a NULL-pointer
dereference. The fix checks if acpi_match_device fails, and if so,
returns -EINVAL.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c