Skip to content

Commit 07293de

Browse files
bvanasschegregkh
authored andcommitted
scsi: qla2xxx: Always check the return value of qla24xx_get_isp_stats()
[ Upstream commit a2b2cc660822cae08c351c7f6b452bfd1330a4f7 ] 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/[email protected] Cc: Quinn Tran <[email protected]> Cc: Mike Christie <[email protected]> Cc: Himanshu Madhani <[email protected]> Cc: Daniel Wagner <[email protected]> Cc: Lee Duncan <[email protected]> Reviewed-by: Daniel Wagner <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 9874fab commit 07293de

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/scsi/qla2xxx/qla_attr.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1909,6 +1909,8 @@ qla2x00_reset_host_stats(struct Scsi_Host *shost)
19091909
vha->qla_stats.jiffies_at_last_reset = get_jiffies_64();
19101910

19111911
if (IS_FWI2_CAPABLE(ha)) {
1912+
int rval;
1913+
19121914
stats = dma_alloc_coherent(&ha->pdev->dev,
19131915
sizeof(*stats), &stats_dma, GFP_KERNEL);
19141916
if (!stats) {
@@ -1918,7 +1920,11 @@ qla2x00_reset_host_stats(struct Scsi_Host *shost)
19181920
}
19191921

19201922
/* reset firmware statistics */
1921-
qla24xx_get_isp_stats(base_vha, stats, stats_dma, BIT_0);
1923+
rval = qla24xx_get_isp_stats(base_vha, stats, stats_dma, BIT_0);
1924+
if (rval != QLA_SUCCESS)
1925+
ql_log(ql_log_warn, vha, 0x70de,
1926+
"Resetting ISP statistics failed: rval = %d\n",
1927+
rval);
19221928

19231929
dma_free_coherent(&ha->pdev->dev, sizeof(*stats),
19241930
stats, stats_dma);

0 commit comments

Comments
 (0)