Skip to content

Commit 8b0fb6f

Browse files
error27gregkh
authored andcommitted
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 <error27@gmail.com> Acked-by: huajun li <huajun.li.lee@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent e0cc8a6 commit 8b0fb6f

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

‎drivers/usb/storage/ene_ub6250.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,10 +491,6 @@ static int ene_load_bincode(struct us_data *us, unsigned char flag)
491491
if (info->BIN_FLAG == flag)
492492
return USB_STOR_TRANSPORT_GOOD;
493493

494-
buf = kmalloc(ENE_BIN_CODE_LEN, GFP_KERNEL);
495-
if (buf == NULL)
496-
return USB_STOR_TRANSPORT_ERROR;
497-
498494
switch (flag) {
499495
/* For SD */
500496
case SD_INIT1_PATTERN:

0 commit comments

Comments
 (0)