linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: 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>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Sasha Levin <sashal@kernel.org>,
	linux-scsi@vger.kernel.org
Subject: [PATCH AUTOSEL 5.4 25/57] scsi: qla2xxx: Always check the return value of qla24xx_get_isp_stats()
Date: Mon,  3 May 2021 12:39:09 -0400	[thread overview]
Message-ID: <20210503163941.2853291-25-sashal@kernel.org> (raw)
In-Reply-To: <20210503163941.2853291-1-sashal@kernel.org>

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

[ 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/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>
---
 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 bed7e8637217..580d30cd5c35 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -2691,6 +2691,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) {
@@ -2700,7 +2702,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);
-- 
2.30.2


  parent reply	other threads:[~2021-05-03 16:52 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 16:38 [PATCH AUTOSEL 5.4 01/57] drm: Added orientation quirk for OneGX1 Pro Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 02/57] drm/qxl: release shadow on shutdown Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 03/57] drm/amd/display: Check for DSC support instead of ASIC revision Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 04/57] drm/amd/display: Don't optimize bandwidth before disabling planes Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 05/57] scsi: lpfc: Fix incorrect dbde assignment when building target abts wqe Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 06/57] scsi: lpfc: Fix pt2pt connection does not recover after LOGO Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 07/57] scsi: target: pscsi: Fix warning in pscsi_complete_cmd() Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 08/57] media: ite-cir: check for receive overflow Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 09/57] media: drivers: media: pci: sta2x11: fix Kconfig dependency on GPIOLIB Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 10/57] media: imx: capture: Return -EPIPE from __capture_legacy_try_fmt() Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 11/57] power: supply: bq27xxx: fix power_avg for newer ICs Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 12/57] extcon: arizona: Fix some issues when HPDET IRQ fires after the jack has been unplugged Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 13/57] extcon: arizona: Fix various races on driver unbind Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 14/57] media: media/saa7164: fix saa7164_encoder_register() memory leak bugs Sasha Levin
2021-05-03 16:38 ` [PATCH AUTOSEL 5.4 15/57] media: gspca/sq905.c: fix uninitialized variable Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 16/57] media: pci: saa7164: Rudimentary spelling fixes in the file saa7164-types.h Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 17/57] power: supply: Use IRQF_ONESHOT Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 18/57] drm/bridge/analogix/anx78xx: Setup encoder before registering connector Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 19/57] drm/bridge/analogix/anx78xx: Cleanup on error in anx78xx_bridge_attach() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 20/57] drm/amdgpu: mask the xgmi number of hops reported from psp to kfd Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 21/57] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 22/57] drm/amdgpu : Fix asic reset regression issue introduce by 8f211fe8ac7c4f Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 23/57] drm/amd/display: Fix UBSAN warning for not a valid value for type '_Bool' Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 24/57] drm/amd/display: fix dml prefetch validation Sasha Levin
2021-05-03 16:39 ` Sasha Levin [this message]
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 26/57] drm/vkms: fix misuse of WARN_ON Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 27/57] scsi: qla2xxx: Fix use after free in bsg Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 28/57] mmc: sdhci-pci: Add PCI IDs for Intel LKF Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 29/57] ata: ahci: Disable SXS for Hisilicon Kunpeng920 Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 30/57] scsi: smartpqi: Correct request leakage during reset operations Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 31/57] scsi: smartpqi: Add new PCI IDs Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 32/57] scsi: scsi_dh_alua: Remove check for ASC 24h in alua_rtpg() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 33/57] media: em28xx: fix memory leak Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 34/57] media: vivid: update EDID Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 35/57] clk: socfpga: arria10: Fix memory leak of socfpga_clk on error return Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 36/57] power: supply: generic-adc-battery: fix possible use-after-free in gab_remove() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 37/57] power: supply: s3c_adc_battery: fix possible use-after-free in s3c_adc_bat_remove() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 38/57] media: tc358743: fix possible use-after-free in tc358743_remove() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 39/57] media: adv7604: fix possible use-after-free in adv76xx_remove() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 40/57] media: i2c: adv7511-v4l2: fix possible use-after-free in adv7511_remove() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 41/57] media: i2c: tda1997: Fix possible use-after-free in tda1997x_remove() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 42/57] media: i2c: adv7842: fix possible use-after-free in adv7842_remove() Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 43/57] media: platform: sti: Fix runtime PM imbalance in regs_show Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 44/57] media: dvb-usb: fix memory leak in dvb_usb_adapter_init Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 45/57] media: gscpa/stv06xx: fix memory leak Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 46/57] sched/fair: Ignore percpu threads for imbalance pulls Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 47/57] drm/msm/mdp5: Configure PP_SYNC_HEIGHT to double the vtotal Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 48/57] drm/msm/mdp5: Do not multiply vclk line count by 100 Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 49/57] drm/amdkfd: Fix cat debugfs hang_hws file causes system crash bug Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 50/57] amdgpu: avoid incorrect %hu format string Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 51/57] drm/amdgpu: fix NULL pointer dereference Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 52/57] scsi: lpfc: Fix crash when a REG_RPI mailbox fails triggering a LOGO response Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 53/57] scsi: lpfc: Fix error handling for mailboxes completed in MBX_POLL mode Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 54/57] scsi: lpfc: Remove unsupported mbox PORT_CAPABILITIES logic Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 55/57] mfd: arizona: Fix rumtime PM imbalance on error Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 56/57] scsi: libfc: Fix a format specifier Sasha Levin
2021-05-03 16:39 ` [PATCH AUTOSEL 5.4 57/57] s390/archrandom: add parameter check for s390_arch_random_generate Sasha Levin

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=20210503163941.2853291-25-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=bvanassche@acm.org \
    --cc=dwagner@suse.de \
    --cc=himanshu.madhani@oracle.com \
    --cc=lduncan@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    --cc=qutran@marvell.com \
    --cc=stable@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).