Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp413486pxj; Thu, 20 May 2021 12:14:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwp5fFqK+1s9OV54D+pNvY2VgPpzNY0JCikJkfAUT/6n+gIOuclVS/aUn/f2dP/OeOorXwm X-Received: by 2002:aa7:dc0b:: with SMTP id b11mr6685291edu.124.1621538081974; Thu, 20 May 2021 12:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621538081; cv=none; d=google.com; s=arc-20160816; b=ZPPWxLWzDsHxmb6WmPYZnzZQGeUgRzrjOkLDs/8Qn4NXq9/i25cLD/+KOJ8uZlWU8F TbbAi81hzkTonzM+geEcp81vAWpvSK3Uz1wIm55PmYkSPwJRe97f1kzBqNjctbXrxcsg XcL1Y9wD/rSZ3hXGZ0hh5fysPACOwAjuzYWa97HSGUVR8j/EHZ5pv53gjjhMWt57hfvj vO2WUMk8AoCjd5nAyeCTGnkDRbc0gSinVN0MKHZurDLmuPfLr9ntwJ2UKcrC6AIQxkrR r2XAw1ImAsTN6pqluvfLjyxnIrOPEzloUcUgfveFQQMehXYeHLgf0ZxrSzOguopsH+4X RXnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=h1D68wALVROVu7DAmKark0qHo83t2kcrF3CmGqTB26k=; b=XRbNyBkfz0p4ZACHH2yEJ/mJuAygZNA3iRf4M6ldAV37EmbOXDNfI6FB4Ls2RJjc85 4x8rjlTi9faPgi8+ZjgKThkDdueb5I8ijd+LNOdbNCDPsPNSmjSJgRAceHSGJ7DCLlXl Wi2KaceF5JmAf0sYnh8phy5dT0LBq+6ltWDWq/SYT6ZMznxDU7//NJSdCgP7N6ie3FCT AomPyrL8SY1vDR4ow/V79aE26ia1GnaS8cj0tZXudANaf7CylmwR0d8CCssx26gapDSe j4ybHGtuQPz1t1m4CAjIv56iTECMSUjBUr8gn7C+zeO2fWfEK8IjKOFY9oFDIUZTVDqB OjqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=njaKyhjI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id de13si869570edb.343.2021.05.20.12.14.18; Thu, 20 May 2021 12:14:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=njaKyhjI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237100AbhETKcd (ORCPT + 99 others); Thu, 20 May 2021 06:32:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:50912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236371AbhETKTb (ORCPT ); Thu, 20 May 2021 06:19:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1E3F4619B6; Thu, 20 May 2021 09:47:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504029; bh=WbPuvUNjiGwQstkWUvrlZRi+niiFxRAZ6AhJtZhIPXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=njaKyhjIB+14YzbJc+OlqUs7UwaWLfgrhuN12enfZC3obaO+p/Ng+zDP8q/WVAjlP iCJLMI/6iOvkLp1X2FhJxGqBs1La0c0CHNoUvm62q3IK3sH7DWymARXndgf2kS7Cx4 s2+qJ/+CiRZtFJxiS4VYgRkHfYcMIm3vpalV+pxE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Quinn Tran , Mike Christie , Himanshu Madhani , Daniel Wagner , Lee Duncan , Bart Van Assche , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 055/323] scsi: qla2xxx: Always check the return value of qla24xx_get_isp_stats() Date: Thu, 20 May 2021 11:19:07 +0200 Message-Id: <20210520092121.989227991@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bart Van Assche [ 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 Cc: Mike Christie Cc: Himanshu Madhani Cc: Daniel Wagner Cc: Lee Duncan Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- 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 656253285db9..dbfd703d0f46 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -1914,6 +1914,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) { @@ -1923,7 +1925,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