Skip to content

Commit

Permalink
USB: ene_ub6250: fix memory leak in ene_load_bincode()
Browse files Browse the repository at this point in the history
"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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Mar 11, 2011
1 parent e0cc8a6 commit 8b0fb6f
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/usb/storage/ene_ub6250.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8b0fb6f

Please sign in to comment.