Staging: ipack/bridges/tpci200: check if the remove function is available
To avoid a dereference of a NULL pointer, the availability of the function is checked before its use. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6ad0c486a4
commit
786d986ea2
|
@ -764,6 +764,8 @@ out:
|
|||
static void tpci200_slot_remove(struct tpci200_slot *slot)
|
||||
{
|
||||
if ((slot->dev == NULL) ||
|
||||
(slot->dev->driver == NULL) ||
|
||||
(slot->dev->driver->ops == NULL) ||
|
||||
(slot->dev->driver->ops->remove == NULL))
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue