All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: libsas: fix an error code in sas_ata_add_dev()
@ 2023-01-05 10:53 Dan Carpenter
  2023-01-05 11:28 ` Jason Yan
  2023-01-12  4:34 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2023-01-05 10:53 UTC (permalink / raw)
  To: Jason Yan, James E.J. Bottomley
  Cc: Martin K. Petersen, John Garry, Damien Le Moal, Xiang Chen,
	Jie Zhan, linux-scsi, kernel-janitors

This code accidentally returns success instead of -ENOMEM.

Fixes: 7cc7646b4b24 ("scsi: libsas: Factor out sas_ata_add_dev()")
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
 drivers/scsi/libsas/sas_ata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index 177cdaef3cad..f5e1c24f54ca 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;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: libsas: fix an error code in sas_ata_add_dev()
  2023-01-05 10:53 [PATCH] scsi: libsas: fix an error code in sas_ata_add_dev() Dan Carpenter
@ 2023-01-05 11:28 ` Jason Yan
  2023-01-12  4:34 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Yan @ 2023-01-05 11:28 UTC (permalink / raw)
  To: Dan Carpenter, James E.J. Bottomley
  Cc: Martin K. Petersen, John Garry, Damien Le Moal, Xiang Chen,
	Jie Zhan, linux-scsi, kernel-janitors

On 2023/1/5 18:53, Dan Carpenter wrote:
> This code accidentally returns success instead of -ENOMEM.
> 
> Fixes: 7cc7646b4b24 ("scsi: libsas: Factor out sas_ata_add_dev()")
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
>   drivers/scsi/libsas/sas_ata.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
> index 177cdaef3cad..f5e1c24f54ca 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;

Hi Dan,

Good catch, thanks for the fix.

Reviewed-by: Jason Yan <yanaijie@huawei.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: libsas: fix an error code in sas_ata_add_dev()
  2023-01-05 10:53 [PATCH] scsi: libsas: fix an error code in sas_ata_add_dev() Dan Carpenter
  2023-01-05 11:28 ` Jason Yan
@ 2023-01-12  4:34 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2023-01-12  4:34 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Jason Yan, James E.J. Bottomley, Martin K. Petersen, John Garry,
	Damien Le Moal, Xiang Chen, Jie Zhan, linux-scsi,
	kernel-janitors


Dan,

> This code accidentally returns success instead of -ENOMEM.

Applied to 6.3/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-12  4:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-05 10:53 [PATCH] scsi: libsas: fix an error code in sas_ata_add_dev() Dan Carpenter
2023-01-05 11:28 ` Jason Yan
2023-01-12  4:34 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.