Skip to content

Commit 3487d9e

Browse files
Roland DreierJames Bottomley
authored andcommitted
[SCSI] cxgb3i: Fix error path for module init
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>
1 parent 7407e5b commit 3487d9e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/scsi/cxgb3i/cxgb3i_init.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@ static int __init cxgb3i_init_module(void)
104104
return err;
105105

106106
err = cxgb3i_pdu_init();
107-
if (err < 0)
107+
if (err < 0) {
108+
cxgb3i_iscsi_cleanup();
108109
return err;
110+
}
109111

110112
cxgb3_register_client(&t3c_client);
111113

0 commit comments

Comments
 (0)