From: Kevin McKinney Date: Sat, 13 Oct 2012 03:49:37 +0000 (-0400) Subject: Staging: bcm: Remove null dereference from InterfaceRDM. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=68f7457d064f4c1972b0a58900a5dabcfd6bbb2e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 --- diff --git a/drivers/staging/bcm/InterfaceMisc.c b/drivers/staging/bcm/InterfaceMisc.c index a101f8f93764..179bcc2126a0 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");