From 1dc634772b0daead0e841b9034e88b6c76a05709 Mon Sep 17 00:00:00 2001 From: Kevin McKinney Date: Mon, 15 Aug 2011 22:12:15 -0400 Subject: [PATCH] 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 --- drivers/staging/bcm/Bcmchar.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/bcm/Bcmchar.c b/drivers/staging/bcm/Bcmchar.c index d3f3856e2dc..6f8a75dc1ef 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; } -- 2.39.5