Skip to content

Commit 0d0f9df

Browse files
rolanddNicholas Bellinger
authored andcommitted
target: Don't return success from module_init() if setup fails
If the call to core_dev_release_virtual_lun0() fails, then nothing sets ret to anything other than 0, so even though everything is torn down and freed, target_core_init_configfs() will seem to succeed and the module will be loaded. Fix this by passing the return value on up the chain. Signed-off-by: Roland Dreier <[email protected]> Cc: [email protected] Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent dea5f09 commit 0d0f9df

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/target/target_core_configfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3206,7 +3206,8 @@ static int __init target_core_init_configfs(void)
32063206
if (ret < 0)
32073207
goto out;
32083208

3209-
if (core_dev_setup_virtual_lun0() < 0)
3209+
ret = core_dev_setup_virtual_lun0();
3210+
if (ret < 0)
32103211
goto out;
32113212

32123213
return 0;

0 commit comments

Comments
 (0)