From: Kevin McKinney Date: Tue, 16 Aug 2011 02:12:15 +0000 (-0400) Subject: Staging: bcm: Fix memory leak reported during compile. X-Git-Tag: MMI-PSA29.97-13-9~18234^2^2~864^2~162 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1dc634772b0daead0e841b9034e88b6c76a05709;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git Staging: bcm: Fix memory leak reported during compile. This patch fixes a potential memory leak were temp_buff buffer is not being freed when a certain condition is true. Signed-off-by: Kevin McKinney Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/bcm/Bcmchar.c b/drivers/staging/bcm/Bcmchar.c index d3f3856e2dcc..6f8a75dc1ef0 100644 --- a/drivers/staging/bcm/Bcmchar.c +++ b/drivers/staging/bcm/Bcmchar.c @@ -304,6 +304,8 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "RDM Done On invalid Address : %x Access Denied.\n", (int)sRdmBuffer.Register); + + kfree(temp_buff); return -EINVAL; }