From: Bart Van Assche <bvanassche@acm.org>
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>,
Quinn Tran <qutran@marvell.com>,
Mike Christie <michael.christie@oracle.com>,
Himanshu Madhani <himanshu.madhani@oracle.com>,
Daniel Wagner <dwagner@suse.de>, Lee Duncan <lduncan@suse.com>
Subject: [PATCH v3 6/7] qla2xxx: Always check the return value of qla24xx_get_isp_stats()
Date: Sat, 20 Mar 2021 16:23:58 -0700 [thread overview]
Message-ID: <20210320232359.941-7-bvanassche@acm.org> (raw)
In-Reply-To: <20210320232359.941-1-bvanassche@acm.org>
This patch fixes the following Coverity warning:
CID 361199 (#1 of 1): Unchecked return value (CHECKED_RETURN)
3. check_return: Calling qla24xx_get_isp_stats without checking return
value (as is done elsewhere 4 out of 5 times).
Cc: Quinn Tran <qutran@marvell.com>
Cc: Mike Christie <michael.christie@oracle.com>
Cc: Himanshu Madhani <himanshu.madhani@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_attr.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 63391c9be05d..3aa9869f6fae 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -2864,6 +2864,8 @@ qla2x00_reset_host_stats(struct Scsi_Host *shost)
vha->qla_stats.jiffies_at_last_reset = get_jiffies_64();
if (IS_FWI2_CAPABLE(ha)) {
+ int rval;
+
stats = dma_alloc_coherent(&ha->pdev->dev,
sizeof(*stats), &stats_dma, GFP_KERNEL);
if (!stats) {
@@ -2873,7 +2875,11 @@ qla2x00_reset_host_stats(struct Scsi_Host *shost)
}
/* reset firmware statistics */
- qla24xx_get_isp_stats(base_vha, stats, stats_dma, BIT_0);
+ rval = qla24xx_get_isp_stats(base_vha, stats, stats_dma, BIT_0);
+ if (rval != QLA_SUCCESS)
+ ql_log(ql_log_warn, vha, 0x70de,
+ "Resetting ISP statistics failed: rval = %d\n",
+ rval);
dma_free_coherent(&ha->pdev->dev, sizeof(*stats),
stats, stats_dma);
next prev parent reply other threads:[~2021-03-20 23:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-20 23:23 [PATCH v3 0/7] qla2xxx patches for kernel v5.12 and v5.13 Bart Van Assche
2021-03-20 23:23 ` [PATCH v3 1/7] Revert "qla2xxx: Make sure that aborted commands are freed" Bart Van Assche
2021-03-20 23:23 ` [PATCH v3 2/7] qla2xxx: Constify struct qla_tgt_func_tmpl Bart Van Assche
2021-03-20 23:23 ` [PATCH v3 3/7] qla2xxx: Fix endianness annotations Bart Van Assche
2021-03-20 23:23 ` [PATCH v3 4/7] qla2xxx: Suppress Coverity complaints about dseg_r* Bart Van Assche
2021-03-20 23:23 ` [PATCH v3 5/7] qla2xxx: Simplify qla8044_minidump_process_control() Bart Van Assche
2021-03-20 23:23 ` Bart Van Assche [this message]
2021-03-21 12:03 ` [PATCH v3 6/7] qla2xxx: Always check the return value of qla24xx_get_isp_stats() Daniel Wagner
2021-03-22 15:46 ` Himanshu Madhani
2021-03-20 23:23 ` [PATCH v3 7/7] qla2xxx: Check kzalloc() return value Bart Van Assche
2021-03-21 12:10 ` Daniel Wagner
2021-03-22 5:04 ` [EXT] " Saurav Kashyap
2021-03-22 15:47 ` Himanshu Madhani
2021-03-25 1:48 ` [PATCH v3 0/7] qla2xxx patches for kernel v5.12 and v5.13 Martin K. Petersen
2021-03-25 3:53 ` Martin K. Petersen
2021-03-30 3:54 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210320232359.941-7-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=dwagner@suse.de \
--cc=himanshu.madhani@oracle.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=lduncan@suse.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=michael.christie@oracle.com \
--cc=qutran@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox