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

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
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment