Skip to content

Commit

Permalink
scsi: qla2xxx: Always check the return value of qla24xx_get_isp_stats()
Browse files Browse the repository at this point in the history
[ Upstream commit a2b2cc6 ]

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).

Link: https://lore.kernel.org/r/20210320232359.941-7-bvanassche@acm.org
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>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
bvanassche authored and gregkh committed May 12, 2021
1 parent b454762 commit bc1434f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/scsi/qla2xxx/qla_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit bc1434f

Please sign in to comment.