linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] orinoco_usb: don't release nonexistent firmware
@ 2013-03-07 22:33 Michał Pecio
  2013-03-08 21:02 ` John W. Linville
  0 siblings, 1 reply; 3+ messages in thread
From: Michał Pecio @ 2013-03-07 22:33 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless

From: Michal Pecio <michal.pecio@gmail.com>

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

Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
---

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(-)

diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c
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;
 
-- 

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

* Re: [PATCH] orinoco_usb: don't release nonexistent firmware
  2013-03-07 22:33 [PATCH] orinoco_usb: don't release nonexistent firmware Michał Pecio
@ 2013-03-08 21:02 ` John W. Linville
  2013-03-08 21:42   ` Michał Pecio
  0 siblings, 1 reply; 3+ messages in thread
From: John W. Linville @ 2013-03-08 21:02 UTC (permalink / raw)
  To: Michał Pecio; +Cc: linux-wireless

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

On Thu, Mar 07, 2013 at 11:33:41PM +0100, Michał Pecio wrote:
> From: Michal Pecio <michal.pecio@gmail.com>
> 
> Initialize fw_entry to NULL to prevent cleanup code from passing
> bogus pointer to release_firmware() when priv allocation fails.
> 
> Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
> ---
> 
> 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(-)
> 
> diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c
> 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;
>  
> -- 
> 

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

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

* Re: [PATCH] orinoco_usb: don't release nonexistent firmware
  2013-03-08 21:02 ` John W. Linville
@ 2013-03-08 21:42   ` Michał Pecio
  0 siblings, 0 replies; 3+ messages in thread
From: Michał Pecio @ 2013-03-08 21:42 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless

From: Michal Pecio <michal.pecio@gmail.com>

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

Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
---
 drivers/net/wireless/orinoco/orinoco_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c 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.8.1.5


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

end of thread, other threads:[~2013-03-08 21:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-07 22:33 [PATCH] orinoco_usb: don't release nonexistent firmware Michał Pecio
2013-03-08 21:02 ` John W. Linville
2013-03-08 21:42   ` Michał Pecio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).