Skip to contentSkip to conversation

orinoco_usb: don't release nonexistent firmware

PATCH In review Michał Pecio 2 participants 3 messages Mar 7, 2013 – Mar 8, 2013 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 orinoco_usb: don't release nonexistent firmware

From: Michal Pecio <[email protected]>

Initialize fw_entry to NULL to prevent cleanup code from passing bogus pointer to release_firmware() when priv allocation fails.

---

Applies against v3.8.2.

Issue found by a static checker. I don't own this hardware so the patch hasn't been tested.

Should be valid, though.

 drivers/net/wireless/orinoco/orinoco_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/net/wireless/orinoco/orinoco_usb.c index 01624dc..2e998ac 100644 --- a/drivers/net/wireless/orinoco/orinoco_usb.c +++ b/drivers/net/wireless/orinoco/orinoco_usb.c
@@ -1578,7 +1578,7 @@ static int ezusb_probe(struct usb_interface *interface, struct ezusb_priv *upriv = NULL;
struct usb_interface_descriptor *iface_desc; struct usb_endpoint_descriptor *ep;
- const struct firmware *fw_entry;
+ const struct firmware *fw_entry = NULL;
int retval = 0;
int i;

#1 lore raw

This patch seems to have a lot of whitespace damage, etc. Please revise it into something that applies with 'git am' and resubmit?

Quoted 34 lines · Michał Pecio

From: Michal Pecio <[email protected]>

Initialize fw_entry to NULL to prevent cleanup code from passing bogus pointer to release_firmware() when priv allocation fails.

---

Applies against v3.8.2.

Issue found by a static checker. I don't own this hardware so the patch hasn't been tested.

Should be valid, though.

 drivers/net/wireless/orinoco/orinoco_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/net/wireless/orinoco/orinoco_usb.c index 01624dc..2e998ac 100644 --- a/drivers/net/wireless/orinoco/orinoco_usb.c +++ b/drivers/net/wireless/orinoco/orinoco_usb.c

(quoted diff) +1 -1
@@ -1578,7 +1578,7 @@ static int ezusb_probe(struct usb_interface
 *interface, struct ezusb_priv *upriv = NULL;
 	struct usb_interface_descriptor *iface_desc;
 	struct usb_endpoint_descriptor *ep;
-	const struct firmware *fw_entry;
+	const struct firmware *fw_entry = NULL;
 	int retval = 0;
 	int i;
 
Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.
#2 lore raw

From: Michal Pecio <[email protected]>

Initialize fw_entry to NULL to prevent cleanup code from passing bogus pointer to release_firmware() when priv allocation fails.

---
 drivers/net/wireless/orinoco/orinoco_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/orinoco/orinoco_usb.c +1 -1
index 01624dc..2e998ac 100644
@@ -1578,7 +1578,7 @@ static int ezusb_probe(struct usb_interface *interface,
 	struct ezusb_priv *upriv = NULL;
 	struct usb_interface_descriptor *iface_desc;
 	struct usb_endpoint_descriptor *ep;
-	const struct firmware *fw_entry;
+	const struct firmware *fw_entry = NULL;
 	int retval = 0;
 	int i;
 
Signature · 1 line
1.8.1.5