From: Kevin McKinney Date: Sat, 13 Oct 2012 03:49:38 +0000 (-0400) Subject: Staging: bcm: Remove null dereference from InterfaceWRM. X-Git-Tag: v3.8-rc1~178^2~1185 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2807dbe1ce231a077460c05f4badf165d6e08a03;p=platform%2Fupstream%2Fkernel-adaptation-pc.git Staging: bcm: Remove null dereference from InterfaceWRM. This patch removes a potential null dereference from InterfaceMisc.c, function InterfaceWRM. This error was reported by Smatch. Signed-off-by: Kevin McKinney Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/bcm/InterfaceMisc.c b/drivers/staging/bcm/InterfaceMisc.c index 179bcc2..9c832b3 100644 --- a/drivers/staging/bcm/InterfaceMisc.c +++ b/drivers/staging/bcm/InterfaceMisc.c @@ -55,10 +55,8 @@ int InterfaceWRM(PS_INTERFACE_ADAPTER psIntfAdapter, { int retval = 0; - 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");