[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1370077899.29224.0.camel@localhost.localdomain>
Date: Sat, 01 Jun 2013 11:11:39 +0200
From: Thomas Meyer <thomas@...3r.de>
To: mdharm-usb@...-eyed-alien.net, linux-usb@...r.kernel.org,
usb-storage@...ts.one-eyed-alien.net, linux-kernel@...r.kernel.org
Subject: [PATCH] usb: Cocci spatch "memdup.spatch"
Signed-off-by: Thomas Meyer <thomas@...3r.de>
---
diff -u -p a/drivers/usb/storage/ene_ub6250.c b/drivers/usb/storage/ene_ub6250.c
--- a/drivers/usb/storage/ene_ub6250.c
+++ b/drivers/usb/storage/ene_ub6250.c
@@ -1928,11 +1928,10 @@ static int ene_load_bincode(struct us_da
usb_stor_dbg(us, "load firmware %s failed\n", fw_name);
goto nofw;
}
- buf = kmalloc(sd_fw->size, GFP_KERNEL);
+ buf = kmemdup(sd_fw->data, sd_fw->size, GFP_KERNEL);
if (buf == NULL)
goto nofw;
- memcpy(buf, sd_fw->data, sd_fw->size);
memset(bcb, 0, sizeof(struct bulk_cb_wrap));
bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
bcb->DataTransferLength = sd_fw->size;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists