提交 8b0fb6f8 编写于 作者: D Dan Carpenter 提交者: Greg Kroah-Hartman

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: NDan Carpenter <error27@gmail.com>
Acked-by: Nhuajun li <huajun.li.lee@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 e0cc8a60
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册