mbox series

[v3,0/7] qla2xxx patches for kernel v5.12 and v5.13

Message ID 20210320232359.941-1-bvanassche@acm.org
Headers show
Series qla2xxx patches for kernel v5.12 and v5.13 | expand

Message

Bart Van Assche March 20, 2021, 11:23 p.m. UTC
Hi Martin,

Please consider the first patch in this series for kernel v5.12 and the
remaining patches for kernel v5.13.

Thanks,

Bart.

Changes compared to v2:
- Addressed the v2 review comments.
- Added a seventh patch that adds a kzalloc() return value check.

Changes compared to v1:
- Improved the description of patch 1/6.
- Dropped one patch that is already upstream.

Bart Van Assche (7):
  Revert "qla2xxx: Make sure that aborted commands are freed"
  qla2xxx: Constify struct qla_tgt_func_tmpl
  qla2xxx: Fix endianness annotations
  qla2xxx: Suppress Coverity complaints about dseg_r*
  qla2xxx: Simplify qla8044_minidump_process_control()
  qla2xxx: Always check the return value of qla24xx_get_isp_stats()
  qla2xxx: Check kzalloc() return value

 drivers/scsi/qla2xxx/qla_attr.c    |  8 +++++++-
 drivers/scsi/qla2xxx/qla_bsg.c     |  4 ++++
 drivers/scsi/qla2xxx/qla_def.h     |  4 ++--
 drivers/scsi/qla2xxx/qla_iocb.c    |  3 ++-
 drivers/scsi/qla2xxx/qla_isr.c     |  2 +-
 drivers/scsi/qla2xxx/qla_mr.c      | 12 ++++++------
 drivers/scsi/qla2xxx/qla_mr.h      |  8 ++++++--
 drivers/scsi/qla2xxx/qla_nx2.c     |  8 --------
 drivers/scsi/qla2xxx/qla_sup.c     |  9 +++++----
 drivers/scsi/qla2xxx/qla_target.c  | 13 +++++--------
 drivers/scsi/qla2xxx/tcm_qla2xxx.c |  6 +-----
 11 files changed, 39 insertions(+), 38 deletions(-)

Comments

Daniel Wagner March 21, 2021, 12:10 p.m. UTC | #1
On Sat, Mar 20, 2021 at 04:23:59PM -0700, Bart Van Assche wrote:
>  	data = kzalloc(response_len, GFP_KERNEL);

> +	if (!data) {

> +		kfree(req_data);

> +		return -ENOMEM;

> +	}


There is the host_stat_out label which could be reused for the exit
path. I am not sure if this the preferred solution by the
maintainers.

Reviewed-by: Daniel Wagner <dwagner@suse.de>
Saurav Kashyap March 22, 2021, 5:04 a.m. UTC | #2
Hi Bart,

> -----Original Message-----

> From: Bart Van Assche <bvanassche@acm.org>

> Sent: Sunday, March 21, 2021 4:54 AM

> To: Martin K . Petersen <martin.petersen@oracle.com>; James E . J .

> Bottomley <jejb@linux.vnet.ibm.com>

> Cc: linux-scsi@vger.kernel.org; Bart Van Assche <bvanassche@acm.org>;

> Himanshu Madhani <himanshu.madhani@oracle.com>; Saurav Kashyap

> <skashyap@marvell.com>; Nilesh Javali <njavali@marvell.com>; Quinn Tran

> <qutran@marvell.com>; Mike Christie <michael.christie@oracle.com>;

> Daniel Wagner <dwagner@suse.de>; Lee Duncan <lduncan@suse.com>

> Subject: [EXT] [PATCH v3 7/7] qla2xxx: Check kzalloc() return value

> 

> External Email

> 

> ----------------------------------------------------------------------

> Instead of crashing if kzalloc() fails, make qla2x00_get_host_stats()

> return -ENOMEM.

> 

> Fixes: dbf1f53cfd23 ("scsi: qla2xxx: Implementation to get and manage host,

> target stats and initiator port")

> Cc: Himanshu Madhani <himanshu.madhani@oracle.com>

> Cc: Saurav Kashyap <skashyap@marvell.com>

> Cc: Nilesh Javali <njavali@marvell.com>

> Cc: Quinn Tran <qutran@marvell.com>

> Cc: Mike Christie <michael.christie@oracle.com>

> Cc: Daniel Wagner <dwagner@suse.de>

> Cc: Lee Duncan <lduncan@suse.com>

> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

> ---

>  drivers/scsi/qla2xxx/qla_bsg.c | 4 ++++

>  1 file changed, 4 insertions(+)

> 

> diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c

> index bee8cf9f8123..bc84b2f389f8 100644

> --- a/drivers/scsi/qla2xxx/qla_bsg.c

> +++ b/drivers/scsi/qla2xxx/qla_bsg.c

> @@ -2583,6 +2583,10 @@ qla2x00_get_host_stats(struct bsg_job *bsg_job)

>  	}

> 

>  	data = kzalloc(response_len, GFP_KERNEL);

> +	if (!data) {

> +		kfree(req_data);

> +		return -ENOMEM;

> +	}

> 

>  	ret = qla2xxx_get_ini_stats(fc_bsg_to_shost(bsg_job), req_data-

> >stat_type,

>  				    data, response_len);


Thanks for the patch.
Acked-by: Saurav Kashyap <skashyap@marvell.com>
Himanshu Madhani March 22, 2021, 3:47 p.m. UTC | #3
> On Mar 20, 2021, at 6:23 PM, Bart Van Assche <bvanassche@acm.org> wrote:

> 

> Instead of crashing if kzalloc() fails, make qla2x00_get_host_stats()

> return -ENOMEM.

> 

> Fixes: dbf1f53cfd23 ("scsi: qla2xxx: Implementation to get and manage host, target stats and initiator port")

> Cc: Himanshu Madhani <himanshu.madhani@oracle.com>

> Cc: Saurav Kashyap <skashyap@marvell.com>

> Cc: Nilesh Javali <njavali@marvell.com>

> Cc: Quinn Tran <qutran@marvell.com>

> Cc: Mike Christie <michael.christie@oracle.com>

> Cc: Daniel Wagner <dwagner@suse.de>

> Cc: Lee Duncan <lduncan@suse.com>

> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

> ---

> drivers/scsi/qla2xxx/qla_bsg.c | 4 ++++

> 1 file changed, 4 insertions(+)

> 

> diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c

> index bee8cf9f8123..bc84b2f389f8 100644

> --- a/drivers/scsi/qla2xxx/qla_bsg.c

> +++ b/drivers/scsi/qla2xxx/qla_bsg.c

> @@ -2583,6 +2583,10 @@ qla2x00_get_host_stats(struct bsg_job *bsg_job)

> 	}

> 

> 	data = kzalloc(response_len, GFP_KERNEL);

> +	if (!data) {

> +		kfree(req_data);

> +		return -ENOMEM;

> +	}

> 

> 	ret = qla2xxx_get_ini_stats(fc_bsg_to_shost(bsg_job), req_data->stat_type,

> 				    data, response_len);



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


--
Himanshu Madhani	 Oracle Linux Engineering
Martin K. Petersen March 25, 2021, 1:48 a.m. UTC | #4
Bart,

> Please consider the first patch in this series for kernel v5.12 and

> the remaining patches for kernel v5.13.


Applied patches 2 through 7 to 5.13/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering
Martin K. Petersen March 25, 2021, 3:53 a.m. UTC | #5
On Sat, 20 Mar 2021 16:23:52 -0700, Bart Van Assche wrote:

> Please consider the first patch in this series for kernel v5.12 and the

> remaining patches for kernel v5.13.

> 

> Thanks,

> 

> Bart.

> 

> [...]


Applied to 5.12/scsi-fixes, thanks!

[1/7] Revert "qla2xxx: Make sure that aborted commands are freed"
      https://git.kernel.org/mkp/scsi/c/39c0c8553bfb

-- 
Martin K. Petersen	Oracle Linux Engineering
Martin K. Petersen March 30, 2021, 3:54 a.m. UTC | #6
On Sat, 20 Mar 2021 16:23:52 -0700, Bart Van Assche wrote:

> Please consider the first patch in this series for kernel v5.12 and the

> remaining patches for kernel v5.13.

> 

> Thanks,

> 

> Bart.

> 

> [...]


Applied to 5.13/scsi-queue, thanks!

[2/7] qla2xxx: Constify struct qla_tgt_func_tmpl
      https://git.kernel.org/mkp/scsi/c/634b9774d335
[3/7] qla2xxx: Fix endianness annotations
      https://git.kernel.org/mkp/scsi/c/37ce4f3531d4
[4/7] qla2xxx: Suppress Coverity complaints about dseg_r*
      https://git.kernel.org/mkp/scsi/c/17603237f789
[5/7] qla2xxx: Simplify qla8044_minidump_process_control()
      https://git.kernel.org/mkp/scsi/c/a20821e3f471
[6/7] qla2xxx: Always check the return value of qla24xx_get_isp_stats()
      https://git.kernel.org/mkp/scsi/c/a2b2cc660822
[7/7] qla2xxx: Check kzalloc() return value
      https://git.kernel.org/mkp/scsi/c/e5406d8ad4a1

-- 
Martin K. Petersen	Oracle Linux Engineering