All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: dwalker@mvista.com
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.13] Unhandled error condition in aic79xx
Date: Thu, 01 Sep 2005 21:59:41 +0200	[thread overview]
Message-ID: <43175DAD.3020404@gmail.com> (raw)
In-Reply-To: <1125603501.4867.21.camel@dhcp153.mvista.com>

Daniel Walker napsal(a):

>This patch should handle the case when scsi_add_host() fails.
>
>Signed-Off-By: Daniel Walker <dwalker@mvista.com>
>
>Index: linux-2.6.13/drivers/scsi/aic7xxx/aic79xx_osm.c
>===================================================================
>--- linux-2.6.13.orig/drivers/scsi/aic7xxx/aic79xx_osm.c	2005-08-28 23:41:01.000000000 +0000
>+++ linux-2.6.13/drivers/scsi/aic7xxx/aic79xx_osm.c	2005-08-31 18:49:09.000000000 +0000
>@@ -1989,6 +1989,7 @@ ahd_linux_register_host(struct ahd_softc
> 	char	*new_name;
> 	u_long	s;
> 	u_long	target;
>+	int error = 0;
> 
> 	template->name = ahd->description;
> 	host = scsi_host_alloc(template, sizeof(struct ahd_softc *));
>@@ -2065,7 +2066,11 @@ ahd_linux_register_host(struct ahd_softc
> 	ahd_unlock(ahd, &s);
> 
> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
>  
>
Maybe this could go away.

>-	scsi_add_host(host, &ahd->dev_softc->dev); /* XXX handle failure */
>+	error = scsi_add_host(host, &ahd->dev_softc->dev); 
>+	if (error) {
>+		scsi_host_put(host);
>+		return(error);
>  
>
no ( ) around return value, please

>+	}
> 	scsi_scan_host(host);
> #endif
> 	return (0);
>  
>
regards,

-- 
Jiri Slaby         www.fi.muni.cz/~xslaby
~\-/~      jirislaby@gmail.com      ~\-/~
241B347EC88228DE51EE A49C4A73A25004CB2A10


  reply	other threads:[~2005-09-01 20:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-01 19:38 [PATCH 2.6.13] Unhandled error condition in aic79xx Daniel Walker
2005-09-01 19:59 ` Jiri Slaby [this message]
2005-09-01 20:10 ` Alexey Dobriyan
2005-09-01 20:19   ` Daniel Walker
2005-09-01 22:21   ` Daniel Walker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43175DAD.3020404@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=akpm@osdl.org \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.