Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2483309pxj; Mon, 10 May 2021 04:11:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytduuGwqDIVueWUEkBV4whA9DEClexwNfmK6iuTUBfY2w8acz6xBin+6K2bKGa5lJs7HfA X-Received: by 2002:a05:6402:341:: with SMTP id r1mr28687763edw.113.1620645074880; Mon, 10 May 2021 04:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645074; cv=none; d=google.com; s=arc-20160816; b=QSEFbRD/kAdbtq9jvILCJnZ/rdqNTN9fKIZApa13YDWXkXRKoIBFciWZj8E4xnnGEF 1DIXYhJhMjo/eO3PEhR7r89a66SdCecpC5EOSMiRDc7sMvrElbiVSACaYKSWuRa8jaZK lJKkeWAni7I+QiLdb+oEeaRkD1vo6JS0Yxk98Rrh+TW2/sNchrFlWhOXBsyN6aRTwp9F lIiszyAIraVA9+2jkCMUhcRsiCnuZi6xLJSLK+tq/bGWJK4p7BgLLi6QyP4rj1KKrZCM wGTZZlmobBhlHuqp6BVSqwhhN1uDbUWfHkQNajltypqDmjYodakg1e4wGMtMzu8B+YGH Iv/A== 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=kJR3Io/I1lldIAxvdaVrjm7bBw41hYxsp0eZW+tDqIQ=; b=Uz4BPZHBGrnWAnKRTG7w/mQ2lvOzDWUhniQg90IyHpVUypizt1zmHtSs/p84Jt4qbG 1mqUB1pxQSriJLxAOOOcG9Ih0O7uLmyTpVdMaJjUGPLdO7v3W0ZQFud1zs+adqAyptun 6XRczJ9CLax4pawZ4lvYWqe9xFeZBfVPzQsTli8fBPU0S6QQzVgJ6Y8JIHn5Xq8H4NRo VMorB7aOZJ82i0k+1nrk56miFa9wl9UuKJ74ncDIT3qmP0XWy/zwAlibk0eY9cjqkrgx +gkIjzausmEuXgZpzZhGcrJSYgK2+g//havYLPh/Rk/GYSbQfK+9wlpaYOAr3LsDH09Z HIsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EYxGZj7b; 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 cq9si10465311edb.534.2021.05.10.04.10.51; Mon, 10 May 2021 04:11:14 -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=EYxGZj7b; 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 S235958AbhEJLHE (ORCPT + 99 others); Mon, 10 May 2021 07:07:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:57592 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232392AbhEJKqL (ORCPT ); Mon, 10 May 2021 06:46:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D15266193B; Mon, 10 May 2021 10:37:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643028; bh=OmAsP+tYBJDtFQWqX428dKjCzbn7jC2wicgTcopdX3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EYxGZj7bfsIvARRawadOyfDVntJa6Q/C5aTlUHScdADv1ySbpmLdXV5ZI70kD+DPs ms6mj+LaccHJ1GgAZB/6cfBuCw0EYuOW32IBS3st5+TVgkrYi6rFrXETPiLjcYbpgB xm+YUjw8EXDM7VowW+jHpy/f3K9i8HuksIKQiDbo= 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 5.10 148/299] scsi: qla2xxx: Always check the return value of qla24xx_get_isp_stats() Date: Mon, 10 May 2021 12:19:05 +0200 Message-Id: <20210510102009.849026419@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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 ab45ac1e5a72..6a2c4a6fcded 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -2855,6 +2855,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) { @@ -2864,7 +2866,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