OSDN Git Service

extcon: palmas: Check the parent instance to prevent the NULL
authorRoger Quadros <rogerq@ti.com>
Thu, 8 Dec 2016 08:45:31 +0000 (10:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Nov 2017 08:21:18 +0000 (09:21 +0100)
commit2bb04f1ff63db7e331179483c1f79d9d9ac30342
tree48a731426ef1b6ea2aa2692449dd955934585e13
parent8d9142ff444e789d8ac34db1db5214a043484f86
extcon: palmas: Check the parent instance to prevent the NULL

[ Upstream commit 9fe172b9be532acc23e35ba693700383ab775e66 ]

extcon-palmas must be child of palmas and expects parent's
drvdata to be valid. Check for non NULL parent drvdata and
fail if it is NULL. Not doing so will result in a NULL
pointer dereference later in the probe() parent drvdata
is NULL (e.g. misplaced extcon-palmas node in device tree).

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/extcon/extcon-palmas.c