From: Dan Carpenter <error27@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: [patch] USB: ene_ub6250: fix memory leak in ene_load_bincode()
Date: Thu, 10 Mar 2011 08:31:33 +0000 [thread overview]
Message-ID: <20110310083133.GL3416@bicker> (raw)
"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>
diff --git a/drivers/usb/storage/ene_ub6250.c b/drivers/usb/storage/ene_ub6250.c
index 058c5d5..08e0374 100644
--- a/drivers/usb/storage/ene_ub6250.c
+++ b/drivers/usb/storage/ene_ub6250.c
@@ -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:
next reply other threads:[~2011-03-10 8:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-10 8:31 Dan Carpenter [this message]
2011-03-10 10:03 ` [patch] USB: ene_ub6250: fix memory leak in ene_load_bincode() huajun li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110310083133.GL3416@bicker \
--to=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox