diff options
author | Samuel Iglesias Gonsalvez <siglesias@igalia.com> | 2012-05-23 13:54:44 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-07 05:14:08 (GMT) |
commit | 786d986ea25632e3d8e7ad5ac2780861ff2b654f (patch) | |
tree | ed2261af2454c7519f61828c44b0d29bf0387406 | |
parent | 6ad0c486a4e702fa059ea24c2585c416f01f4664 (diff) | |
download | linux-fsl-qoriq-786d986ea25632e3d8e7ad5ac2780861ff2b654f.tar.xz |
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>
-rw-r--r-- | drivers/staging/ipack/bridges/tpci200.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/ipack/bridges/tpci200.c b/drivers/staging/ipack/bridges/tpci200.c index 0c2a50a..ee26d9a 100644 --- a/drivers/staging/ipack/bridges/tpci200.c +++ b/drivers/staging/ipack/bridges/tpci200.c @@ -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; |