Skip to content

Commit

Permalink
Staging: ipack/bridges/tpci200: check if the remove function is avail…
Browse files Browse the repository at this point in the history
…able

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>
  • Loading branch information
Samuel Iglesias Gonsalvez authored and Greg Kroah-Hartman committed Jun 7, 2012
1 parent 6ad0c48 commit 786d986
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/ipack/bridges/tpci200.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 786d986

Please sign in to comment.