Skip to content

Commit

Permalink
scsi: libsas: Fix an error code in sas_ata_add_dev()
Browse files Browse the repository at this point in the history
This code accidentally returns success instead of -ENOMEM.

Fixes: 7cc7646 ("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>
  • Loading branch information
Dan Carpenter authored and Martin K. Petersen committed Jan 12, 2023
1 parent 58edf8b commit 8fe66ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/libsas/sas_ata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8fe66ba

Please sign in to comment.