[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1337781287-28628-6-git-send-email-siglesias@igalia.com>
Date: Wed, 23 May 2012 15:54:44 +0200
From: Samuel Iglesias Gonsalvez <siglesias@...lia.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Dan Carpenter <dan.carpenter@...cle.com>
Cc: Samuel Iglesias Gonsalvez <siglesias@...lia.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH 5/8] 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@...lia.com>
---
drivers/staging/ipack/bridges/tpci200.c | 2 ++
1 file changed, 2 insertions(+)
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;
--
1.7.10
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists