USB: ene_ub6250: fix memory leak in ene_load_bincode()
Subsystems (3)
PATCH 1/1 USB: ene_ub6250: fix memory leak in ene_load_bincode()
"buf" gets allocated twice in a row. It's the second allocation which is correct. The first one should be removed.
Signed-off-by Dan Carpenter <[email protected]>
drivers/usb/storage/ene_ub6250.c +0 -4
@@ -491,10 +491,6 @@ static int ene_load_bincode(struct us_data *us, unsigned char flag)if (info->BIN_FLAG = flag)return USB_STOR_TRANSPORT_GOOD ; - buf =kmalloc (ENE_BIN_CODE_LEN ,GFP_KERNEL ); -if (buf =NULL ) -return USB_STOR_TRANSPORT_ERROR ; -switch (flag) {/* For SD */ case SD_INIT1_PATTERN :
Yes, you are right, thanks. :)
Thanks,
--huajun
2011/3/10 Dan Carpenter <[email protected]>:
Quoted 19 lines
"buf" gets allocated twice in a row. It's the second allocation which is correct. The first one should be removed.
Signed-off-by Dan Carpenter <[email protected]>drivers/usb/storage/ene_ub6250.c +0
-4@@ -491,10 +491,6 @@ static int ene_load_bincode(struct us_data *us, unsigned char flag) if (info->BIN_FLAG = flag) return USB_STOR_TRANSPORT_GOOD; - buf = kmalloc(ENE_BIN_CODE_LEN, GFP_KERNEL); - if (buf = NULL) - return USB_STOR_TRANSPORT_ERROR; - switch (flag) { /* For SD */
Quoted 2 lines
case
SD_INIT1_PATTERN:
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html