diff options
author | Samuel Iglesias Gonsalvez <siglesias@igalia.com> | 2012-05-23 15:54:44 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-07 14:14:08 +0900 |
commit | 786d986ea25632e3d8e7ad5ac2780861ff2b654f (patch) | |
tree | ed2261af2454c7519f61828c44b0d29bf0387406 /drivers/staging/ipack | |
parent | 6ad0c486a4e702fa059ea24c2585c416f01f4664 (diff) | |
download | blackbird-obmc-linux-786d986ea25632e3d8e7ad5ac2780861ff2b654f.tar.gz blackbird-obmc-linux-786d986ea25632e3d8e7ad5ac2780861ff2b654f.zip |
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>
Diffstat (limited to 'drivers/staging/ipack')
-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 0c2a50a1ec00..ee26d9a7e370 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; |