Skip to content

Commit

Permalink
[SCSI] cxgb3i: Fix error path for module init
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Cc: Karen Xie <kxie@chelsio.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Roland Dreier authored and James Bottomley committed May 2, 2010
1 parent 7407e5b commit 3487d9e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/scsi/cxgb3i/cxgb3i_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 3487d9e

Please sign in to comment.