public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] USB: ene_ub6250: fix memory leak in ene_load_bincode()
@ 2011-03-10  8:31 Dan Carpenter
  2011-03-10 10:03 ` huajun li
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-03-10  8:31 UTC (permalink / raw)
  To: kernel-janitors

"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:

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-10 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-10  8:31 [patch] USB: ene_ub6250: fix memory leak in ene_load_bincode() Dan Carpenter
2011-03-10 10:03 ` huajun li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox