kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs()
@ 2020-06-19 14:30 Dan Carpenter
  2020-06-24 17:59 ` Shyam Sundar
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-06-19 14:30 UTC (permalink / raw)
  To: Nilesh Javali, Darren Trapp
  Cc: GR-QLogic-Storage-Upstream, James E.J. Bottomley,
	Martin K. Petersen, Himanshu Madhani, Johannes Thumshirn,
	Hannes Reinecke, linux-scsi, kernel-janitors

This code doesn't make sense unless the correct "fcport" was found.

Fixes: 9dd9686b1419 ("scsi: qla2xxx: Add changes for devloss timeout in driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This is from static analysis and review.  I'm not super familiar with
the code and I can't test it.  Please review it extra carefully.

 drivers/scsi/qla2xxx/qla_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 4576d3ae9937..2436a17f5cd9 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -5944,7 +5944,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha)
 			break;
 		}
 
-		if (NVME_TARGET(vha->hw, fcport)) {
+		if (found && NVME_TARGET(vha->hw, fcport)) {
 			if (fcport->disc_state = DSC_DELETE_PEND) {
 				qla2x00_set_fcport_disc_state(fcport, DSC_GNL);
 				vha->fcport_count--;
-- 
2.27.0

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

* Re: [PATCH] scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs()
  2020-06-19 14:30 [PATCH] scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs() Dan Carpenter
@ 2020-06-24 17:59 ` Shyam Sundar
  2020-06-25 14:11 ` Himanshu Madhani
  2020-06-27  3:09 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Shyam Sundar @ 2020-06-24 17:59 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Nilesh Javali, Darren Trapp, GR-QLogic-Storage-Upstream,
	James E.J. Bottomley, Martin K. Petersen, Himanshu Madhani,
	Johannes Thumshirn, Hannes Reinecke, linux-scsi, kernel-janitors

+1.

Reviewed-by: Shyam Sundar <ssundar@marvell.com>

> On Jun 19, 2020, at 7:30 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 
> This code doesn't make sense unless the correct "fcport" was found.
> 
> Fixes: 9dd9686b1419 ("scsi: qla2xxx: Add changes for devloss timeout in driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> This is from static analysis and review.  I'm not super familiar with
> the code and I can't test it.  Please review it extra carefully.
> 
> drivers/scsi/qla2xxx/qla_init.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
> index 4576d3ae9937..2436a17f5cd9 100644
> --- a/drivers/scsi/qla2xxx/qla_init.c
> +++ b/drivers/scsi/qla2xxx/qla_init.c
> @@ -5944,7 +5944,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha)
> 			break;
> 		}
> 
> -		if (NVME_TARGET(vha->hw, fcport)) {
> +		if (found && NVME_TARGET(vha->hw, fcport)) {
> 			if (fcport->disc_state == DSC_DELETE_PEND) {
> 				qla2x00_set_fcport_disc_state(fcport, DSC_GNL);
> 				vha->fcport_count--;
> -- 
> 2.27.0
> 

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

* Re: [PATCH] scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs()
  2020-06-19 14:30 [PATCH] scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs() Dan Carpenter
  2020-06-24 17:59 ` Shyam Sundar
@ 2020-06-25 14:11 ` Himanshu Madhani
  2020-06-27  3:09 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Himanshu Madhani @ 2020-06-25 14:11 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Nilesh Javali, GR-QLogic-Storage-Upstream, James E.J. Bottomley,
	Martin K. Petersen, Hannes Reinecke, linux-scsi, kernel-janitors



> On Jun 19, 2020, at 9:30 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 
> This code doesn't make sense unless the correct "fcport" was found.
> 
> Fixes: 9dd9686b1419 ("scsi: qla2xxx: Add changes for devloss timeout in driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> This is from static analysis and review.  I'm not super familiar with
> the code and I can't test it.  Please review it extra carefully.
> 
> drivers/scsi/qla2xxx/qla_init.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
> index 4576d3ae9937..2436a17f5cd9 100644
> --- a/drivers/scsi/qla2xxx/qla_init.c
> +++ b/drivers/scsi/qla2xxx/qla_init.c
> @@ -5944,7 +5944,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha)
> 			break;
> 		}
> 
> -		if (NVME_TARGET(vha->hw, fcport)) {
> +		if (found && NVME_TARGET(vha->hw, fcport)) {
> 			if (fcport->disc_state == DSC_DELETE_PEND) {
> 				qla2x00_set_fcport_disc_state(fcport, DSC_GNL);
> 				vha->fcport_count--;
> -- 
> 2.27.0
> 

Looks Good. 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	Oracle Linux Engineering

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

* Re: [PATCH] scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs()
  2020-06-19 14:30 [PATCH] scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs() Dan Carpenter
  2020-06-24 17:59 ` Shyam Sundar
  2020-06-25 14:11 ` Himanshu Madhani
@ 2020-06-27  3:09 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2020-06-27  3:09 UTC (permalink / raw)
  To: Dan Carpenter, Nilesh Javali, Darren Trapp
  Cc: Martin K . Petersen, linux-scsi, kernel-janitors,
	Hannes Reinecke, Johannes Thumshirn, James E.J. Bottomley,
	Himanshu Madhani, GR-QLogic-Storage-Upstream

On Fri, 19 Jun 2020 17:30:41 +0300, Dan Carpenter wrote:

> This code doesn't make sense unless the correct "fcport" was found.

Applied to 5.8/scsi-fixes, thanks!

[1/1] scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs()
      https://git.kernel.org/mkp/scsi/c/1fc98aaf7f85

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2020-06-27  3:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-19 14:30 [PATCH] scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs() Dan Carpenter
2020-06-24 17:59 ` Shyam Sundar
2020-06-25 14:11 ` Himanshu Madhani
2020-06-27  3:09 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).