[PATCHv2 3/3] staging: bcm: fix memory leak in Bcmchar.c file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit 78cfe85eac64c553278719f691e743969aadf1f2
Author: Kevin McKinney <klmckinney1@xxxxxxxxx>
Date:   Sun Aug 14 21:11:13 2011 -0400

    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 <klmckinney1@xxxxxxxxx>

diff --git a/drivers/staging/bcm/Bcmchar.c b/drivers/staging/bcm/Bcmchar.c
index d3f3856..6f8a75d 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;
 		}
 
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux