linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][SCSI] cxgb3i: Fix error path for module init
@ 2010-04-28  5:39 Roland Dreier
  2010-04-28  6:21 ` Mike Christie
  0 siblings, 1 reply; 2+ messages in thread
From: Roland Dreier @ 2010-04-28  5:39 UTC (permalink / raw)
  To: linux-scsi, Karen Xie, Rakesh Ranjan, Mike Christie,
	James Bottomley

If cxgb3i_pdu_init() fails, then it appears that cxgb3i_iscsi_init()
will not be cleaned up, leading to the iscsi transport being left
registered.  Fix this by adding a call to cxgb3i_iscsi_cleanup() on the
error path.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
---
 drivers/scsi/cxgb3i/cxgb3i_init.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/cxgb3i/cxgb3i_init.c b/drivers/scsi/cxgb3i/cxgb3i_init.c
index d0ab23a..685af36 100644
--- a/drivers/scsi/cxgb3i/cxgb3i_init.c
+++ b/drivers/scsi/cxgb3i/cxgb3i_init.c
@@ -104,8 +104,10 @@ static int __init cxgb3i_init_module(void)
 		return err;
 
 	err = cxgb3i_pdu_init();
-	if (err < 0)
+	if (err < 0) {
+		cxgb3i_iscsi_cleanup();
 		return err;
+	}
 
 	cxgb3_register_client(&t3c_client);
 

-- 
Roland Dreier <rolandd@cisco.com> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html

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

* Re: [PATCH][SCSI] cxgb3i: Fix error path for module init
  2010-04-28  5:39 [PATCH][SCSI] cxgb3i: Fix error path for module init Roland Dreier
@ 2010-04-28  6:21 ` Mike Christie
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Christie @ 2010-04-28  6:21 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-scsi, Karen Xie, Rakesh Ranjan, James Bottomley

On 04/28/2010 12:39 AM, Roland Dreier wrote:
> If cxgb3i_pdu_init() fails, then it appears that cxgb3i_iscsi_init()
> will not be cleaned up, leading to the iscsi transport being left
> registered.  Fix this by adding a call to cxgb3i_iscsi_cleanup() on the
> error path.
>
> Signed-off-by: Roland Dreier<rolandd@cisco.com>
> ---
>   drivers/scsi/cxgb3i/cxgb3i_init.c |    4 +++-
>   1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/scsi/cxgb3i/cxgb3i_init.c b/drivers/scsi/cxgb3i/cxgb3i_init.c
> index d0ab23a..685af36 100644
> --- a/drivers/scsi/cxgb3i/cxgb3i_init.c
> +++ b/drivers/scsi/cxgb3i/cxgb3i_init.c
> @@ -104,8 +104,10 @@ static int __init cxgb3i_init_module(void)
>   		return err;
>
>   	err = cxgb3i_pdu_init();
> -	if (err<  0)
> +	if (err<  0) {
> +		cxgb3i_iscsi_cleanup();
>   		return err;
> +	}
>
>   	cxgb3_register_client(&t3c_client);
>
>

Looks good to me.

Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>

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

end of thread, other threads:[~2010-04-28  6:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-28  5:39 [PATCH][SCSI] cxgb3i: Fix error path for module init Roland Dreier
2010-04-28  6:21 ` Mike Christie

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