From 68f7457d064f4c1972b0a58900a5dabcfd6bbb2e Mon Sep 17 00:00:00 2001 From: Kevin McKinney Date: Fri, 12 Oct 2012 23:49:37 -0400 Subject: [PATCH] Staging: bcm: Remove null dereference from InterfaceRDM. This patch removes a potential null dereference from InterfaceMisc.c, function InterfaceRDM. This error was reported by Smatch. Signed-off-by: Kevin McKinney Signed-off-by: Greg Kroah-Hartman --- drivers/staging/bcm/InterfaceMisc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/bcm/InterfaceMisc.c b/drivers/staging/bcm/InterfaceMisc.c index a101f8f..179bcc2 100644 --- a/drivers/staging/bcm/InterfaceMisc.c +++ b/drivers/staging/bcm/InterfaceMisc.c @@ -7,10 +7,8 @@ int InterfaceRDM(PS_INTERFACE_ADAPTER psIntfAdapter, { int bytes; - if (!psIntfAdapter) { - BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, "Interface Adapter is NULL"); + if (!psIntfAdapter) return -EINVAL; - } if (psIntfAdapter->psAdapter->device_removed == TRUE) { BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, "Device got removed"); -- 2.7.4