All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH][18/26] drivers/usb/image/* - compile warning cleanup
@ 2005-02-10 21:34 Stephen Biggs
  2005-02-10 22:36 ` Alexey Dobriyan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stephen Biggs @ 2005-02-10 21:34 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 829 bytes --]

Description: handle error return from scsi_add_host

Signed-off-by: Stephen Biggs <yrgrknmxpzlk@gawab.com>

diff -Nurdp -X dontdiff-osdl linux-2.6.11-rc3-mm-original/drivers/usb/image/microtek.c linux-2.6.11-rc3-mm/drivers/usb/image/microtek.c
--- linux-2.6.11-rc3-mm-original/drivers/usb/image/microtek.c	2005-02-03 03:57:04.000000000 +0200
+++ linux-2.6.11-rc3-mm/drivers/usb/image/microtek.c	2005-02-09 23:07:41.000000000 +0200
@@ -809,7 +809,11 @@ static int mts_usb_probe(struct usb_inte
 		goto out_free_urb;
 
 	new_desc->host->hostdata[0] = (unsigned long)new_desc;
-	scsi_add_host(new_desc->host, NULL); /* XXX handle failure */
+	if(scsi_add_host(new_desc->host, NULL)) {
+		usb_free_urb(new_desc->urb);
+		kfree(new_desc);
+		return -EIO;
+	}
 	scsi_scan_host(new_desc->host);
 
 	usb_set_intfdata(intf, new_desc);




[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [PATCH][18/26] drivers/usb/image/* - compile warning cleanup
  2005-02-10 21:34 [KJ] [PATCH][18/26] drivers/usb/image/* - compile warning cleanup Stephen Biggs
@ 2005-02-10 22:36 ` Alexey Dobriyan
  2005-02-10 23:15 ` Stephen Biggs
  2005-02-10 23:23 ` Stephen Biggs
  2 siblings, 0 replies; 4+ messages in thread
From: Alexey Dobriyan @ 2005-02-10 22:36 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]

On Thursday 10 February 2005 23:34, Stephen Biggs wrote:

> --- linux-2.6.11-rc3-mm-original/drivers/usb/image/microtek.c
> +++ linux-2.6.11-rc3-mm/drivers/usb/image/microtek.c
> @@ -809,7 +809,11 @@ static int mts_usb_probe(struct usb_inte
>  		goto out_free_urb;
>  
>  	new_desc->host->hostdata[0] = (unsigned long)new_desc;
> -	scsi_add_host(new_desc->host, NULL); /* XXX handle failure */
> +	if(scsi_add_host(new_desc->host, NULL)) {
> +		usb_free_urb(new_desc->urb);
> +		kfree(new_desc);
> +		return -EIO;
> +	}

Should be:

	if (scsi_add_host(new_desc->host, NULL)) {
		rc = -E____;
		goto out_free_urb;
	}

Yes, yes, I know. There is no rc in mts_usb_probe. ;-)

	Alexey

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [PATCH][18/26] drivers/usb/image/* - compile warning cleanup
  2005-02-10 21:34 [KJ] [PATCH][18/26] drivers/usb/image/* - compile warning cleanup Stephen Biggs
  2005-02-10 22:36 ` Alexey Dobriyan
@ 2005-02-10 23:15 ` Stephen Biggs
  2005-02-10 23:23 ` Stephen Biggs
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Biggs @ 2005-02-10 23:15 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 1147 bytes --]

On 11 Feb 2005 at 1:27, Alexey Dobriyan wrote:

> On Thursday 10 February 2005 23:34, Stephen Biggs wrote:
> 
> > --- linux-2.6.11-rc3-mm-original/drivers/usb/image/microtek.c
> > +++ linux-2.6.11-rc3-mm/drivers/usb/image/microtek.c
> > @@ -809,7 +809,11 @@ static int mts_usb_probe(struct usb_inte
> >  		goto out_free_urb;
> >  
> >  	new_desc->host->hostdata[0] = (unsigned long)new_desc;
> > -	scsi_add_host(new_desc->host, NULL); /* XXX handle failure */
> > +	if(scsi_add_host(new_desc->host, NULL)) {
> > +		usb_free_urb(new_desc->urb);
> > +		kfree(new_desc);
> > +		return -EIO;
> > +	}
> 
> Should be:
> 
> 	if (scsi_add_host(new_desc->host, NULL)) {
> 		rc = -E____;
> 		goto out_free_urb;
> 	}
> 
> Yes, yes, I know. There is no rc in mts_usb_probe. ;-)

This is why I didn't do it your way.  I made the judgement call of not 
adding another patch line and an rc variable that would either only be 
used in one place, or I would have change the entire function to use "rc" 
consistently.  My patch is, instead, a deletion of one line and an 
addition of 5 lines all in one place; simple.

Thanks for the feedback.

> 
> 	Alexey
> 





[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [PATCH][18/26] drivers/usb/image/* - compile warning cleanup
  2005-02-10 21:34 [KJ] [PATCH][18/26] drivers/usb/image/* - compile warning cleanup Stephen Biggs
  2005-02-10 22:36 ` Alexey Dobriyan
  2005-02-10 23:15 ` Stephen Biggs
@ 2005-02-10 23:23 ` Stephen Biggs
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Biggs @ 2005-02-10 23:23 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 1146 bytes --]

On 11 Feb 2005 at 1:27, Alexey Dobriyan wrote:

> On Thursday 10 February 2005 23:34, Stephen Biggs wrote:
> 
> > --- linux-2.6.11-rc3-mm-original/drivers/usb/image/microtek.c
> > +++ linux-2.6.11-rc3-mm/drivers/usb/image/microtek.c
> > @@ -809,7 +809,11 @@ static int mts_usb_probe(struct usb_inte
> >  		goto out_free_urb;
> >  
> >  	new_desc->host->hostdata[0] = (unsigned long)new_desc;
> > -	scsi_add_host(new_desc->host, NULL); /* XXX handle failure */
> > +	if(scsi_add_host(new_desc->host, NULL)) {
> > +		usb_free_urb(new_desc->urb);
> > +		kfree(new_desc);
> > +		return -EIO;
> > +	}
> 
> Should be:
> 
> 	if (scsi_add_host(new_desc->host, NULL)) {
> 		rc = -E____;
> 		goto out_free_urb;
> 	}
> 
> Yes, yes, I know. There is no rc in mts_usb_probe. ;-)

This is why I didn't do it your way.  I made the judgement call of not 
adding another patch line and an rc variable that would either only be 
used in one place, or I would have change the entire function to use 
"rc" consistently.  My patch is, instead, a deletion of one line and an 
addition of 5 lines all in one place; simple.

Thanks for the feedback.

> 
> 	Alexey
> 




[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2005-02-10 23:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-10 21:34 [KJ] [PATCH][18/26] drivers/usb/image/* - compile warning cleanup Stephen Biggs
2005-02-10 22:36 ` Alexey Dobriyan
2005-02-10 23:15 ` Stephen Biggs
2005-02-10 23:23 ` Stephen Biggs

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.