Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 786d986e authored by Samuel Iglesias Gonsalvez's avatar Samuel Iglesias Gonsalvez Committed by Greg Kroah-Hartman
Browse files

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: default avatarSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6ad0c486
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -764,6 +764,8 @@ static int tpci200_request_irq(struct ipack_device *dev, int vector,
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;