Commit a2b32bc
scsi: ufs: core: Fix invalid probe error return value
After DME Link Startup, the error return value is set to the MIPI UniPro
GenericErrorCode which can be 0 (SUCCESS) or 1 (FAILURE). Upon failure
during driver probe, the error code 1 is propagated back to the driver
probe function which must return a negative value to indicate an error,
but 1 is not negative, so the probe is considered to be successful even
though it failed. Subsequently, removing the driver results in an oops
because it is not in a valid state.
This happens because none of the callers of ufshcd_init() expect a
non-negative error code.
Fix the return value and documentation to match actual usage.
Fixes: 69f5eb7 ("scsi: ufs: core: Move the ufshcd_device_init(hba, true) call")
Cc: stable@vger.kernel.org
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20251024085918.31825-5-adrian.hunter@intel.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>1 parent d968e99 commit a2b32bc
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10656 | 10656 | | |
10657 | 10657 | | |
10658 | 10658 | | |
10659 | | - | |
| 10659 | + | |
10660 | 10660 | | |
10661 | 10661 | | |
10662 | 10662 | | |
| |||
10897 | 10897 | | |
10898 | 10898 | | |
10899 | 10899 | | |
10900 | | - | |
| 10900 | + | |
10901 | 10901 | | |
10902 | 10902 | | |
10903 | 10903 | | |
| |||
0 commit comments