summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas/sas_ata.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2023-01-05 11:53:35 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2023-01-12 05:32:53 +0100
commit8fe66badf036d7505f9f4a03420d39b3ad819965 (patch)
treea1a9f7baae2f29b12e55d03f94ee1019290cc81c /drivers/scsi/libsas/sas_ata.c
parentMerge patch series "Several compilation warnings fixes for UFS Advanced RPMB" (diff)
downloadlinux-8fe66badf036d7505f9f4a03420d39b3ad819965.tar.xz
linux-8fe66badf036d7505f9f4a03420d39b3ad819965.zip
scsi: libsas: Fix an error code in sas_ata_add_dev()
This code accidentally returns success instead of -ENOMEM. Fixes: 7cc7646b4b24 ("scsi: libsas: Factor out sas_ata_add_dev()") Link: https://lore.kernel.org/r/Y7asLxzVwQ56G+ya@kili Signed-off-by: Dan Carpenter <error27@gmail.com> Reviewed-by: Jason Yan <yanaijie@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/libsas/sas_ata.c')
-rw-r--r--drivers/scsi/libsas/sas_ata.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index 9b4a9c3b58f2..4a7e835c24cd 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -716,7 +716,7 @@ int sas_ata_add_dev(struct domain_device *parent, struct ex_phy *phy,
rphy = sas_end_device_alloc(phy->port);
if (!rphy)
- return ret;
+ return -ENOMEM;
rphy->identify.phy_identifier = phy_id;
child->rphy = rphy;