scsi: fdomain: Fix error return code in fdomain_probe()
PATCH v2 1/1 scsi: fdomain: Fix error return code in fdomain_probe()
When it fail to request_region, it just jump to 'fail_disable', while the 'ret' is not updated. So assign the return code before that.
Fixes 8674a8aa2c39 ("scsi: fdomain: Add PCMCIA support")
Reported-by Hulk Robot <[email protected]>
Signed-off-by Wei Li <[email protected]>
--- drivers/scsi/pcmcia/fdomain_cs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/pcmcia/fdomain_cs.c +3 -1
@@ -45,8 +45,10 @@ static int fdomain_probe(struct pcmcia_device *link) goto fail_disable;if (!request_region (link->resource[0 ]->start,FDOMAIN_REGION_SIZE , -"fdomain_cs" )) +"fdomain_cs" )) { + ret = -EBUSY ; goto fail_disable; + } sh =fdomain_create (link->resource[0 ]->start, link->irq,7 , &link->dev);if (!sh) {
Signature · 1 line
2.25.1
Martin K. Petersen
AppliedWei,
Quoted 2 lines
When it fail to
request_region, it just jump to 'fail_disable', while the 'ret' is not updated. So assign the return code before that.
Applied to 5.15/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 8 lines · Wei Li
When it fail to
request_region, it just jump to 'fail_disable', while the 'ret' is not updated. So assign the return code before that.[...]
Applied to 5.15/scsi-queue, thanks!
[1/1] scsi: fdomain: Fix error return code in fdomain_probe()
https://git.kernel.org/mkp/scsi/c/632c4ae6da1d
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering