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: firefly_0821_release~3680^2~4313^2^2~864^2~162 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1dc634772b0daead0e841b9034e88b6c76a05709;p=firefly-linux-kernel-4.4.55.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; }