Received: by 2002:ac8:156:0:b0:3e0:cd10:60c8 with SMTP id f22csp274992qtg; Fri, 31 Mar 2023 01:12:04 -0700 (PDT) X-Google-Smtp-Source: AKy350bQ5ISORREGUmcwSckyuAPqT3dgOCyFPlZgD8u/dcddTToE2BMJP6PwzYpi1iVvphc5DqFC X-Received: by 2002:a17:906:1ce:b0:92e:f520:7762 with SMTP id 14-20020a17090601ce00b0092ef5207762mr4401701ejj.6.1680250324102; Fri, 31 Mar 2023 01:12:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680250324; cv=none; d=google.com; s=arc-20160816; b=NamrJb4k8wk7ENsp9R10prpLEkTWouX1P8eHAXTGOzIvVphH8PsopjmRAe3UaDWz6S 44NnhnJL/z3LhIoPHErBiYE8StqFvB+AqFW8kUkpD9LZXVWhQ1RGVjwtGAJCf1q/fD9e VDPdtwpLRgsyu69sqL6ExLXYpfUw3doljpoSQCWsP2SFqeNf+XKMYJRduaT2mIpsQQE9 YsGqNsMoVvSSy4n2UaB9AbxsEb7Jxeazwjd4OKJl01u4DtaD6470Nj+ovRQKZ0Djm/9J w1Cq4NK4wRm2BN7FUrhe2JJHvMHpWVYfWjVP79q6gmX47iHss8rOmhOoPHQvDbzDHHJk PiOg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=+sWL6z24WHkI1mHsF//PDU19LhlB9QYnVo3MDVRJCvs=; b=cxtovqDTNdrt7WcrMSM325SVuGXLE7UZPy87PfMkmePTeK8wRWRUVorCfi/3bw8tPw 6aahkan2D5k1gbEd7OoxF0dVTAXiv896Z+6BkFP+gHlquhZTzPi9QXfmr3RCVlKPIDiy 8r0O+/V3VykxK5jK/ojBIzGSIIRasqM+179+49tE29s1yXKnYM2CkEwJ0/34Q55sxafo ULBv4zyrQUak8W2kyRB1d0gOGnSNvGekA0IY66lsnNWr8kbmUzlT4Ay1d/p8EAvOTcKe x1NrMZ5I3c/c9Og6oP82aPAmAY4ZW/zbCcT5sfJiDnBZRH8PXu05VwJ449dr96ZZIlt1 SmXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=HOgrJ+JV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m6-20020a170906234600b0093defbd627fsi1447648eja.1030.2023.03.31.01.11.39; Fri, 31 Mar 2023 01:12:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=HOgrJ+JV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231337AbjCaIGi (ORCPT + 99 others); Fri, 31 Mar 2023 04:06:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbjCaIG2 (ORCPT ); Fri, 31 Mar 2023 04:06:28 -0400 X-Greylist: delayed 93879 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 31 Mar 2023 01:06:18 PDT Received: from forwardcorp1a.mail.yandex.net (forwardcorp1a.mail.yandex.net [IPv6:2a02:6b8:c0e:500:1:45:d181:df01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39CFC1C1F4; Fri, 31 Mar 2023 01:06:17 -0700 (PDT) Received: from mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net [IPv6:2a02:6b8:c18:1421:0:640:53a0:0]) by forwardcorp1a.mail.yandex.net (Yandex) with ESMTP id E0BFB60412; Fri, 31 Mar 2023 11:06:15 +0300 (MSK) Received: from den-plotnikov-w.yandex-team.ru (unknown [2a02:6b8:b081:b509::1:8]) by mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id 56FrmA0Od0U0-3fNi8o71; Fri, 31 Mar 2023 11:06:15 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1680249975; bh=+sWL6z24WHkI1mHsF//PDU19LhlB9QYnVo3MDVRJCvs=; h=Message-Id:Date:Cc:Subject:To:From; b=HOgrJ+JVfs5Ft5A1WbeXah7jZLHc3X71KUOXPA80G94ozeiBdqzUkdt6/y4fKh4GG IyXGXERoVppbXUwD+3yHmqlEqeAQ/QQV2Lky4B6gJcf3FPikxLVi0HNo0p5mW4z0dN n5B8wncTzqFWDoip329rX0uGcytcKjeGwAENjKlU= Authentication-Results: mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Denis Plotnikov To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, shshaikh@marvell.com, manishc@marvell.com, GR-Linux-NIC-Dev@marvell.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, den-plotnikov@yandex-team.ru Subject: [PATCH] qlcnic: check pci_reset_function result Date: Fri, 31 Mar 2023 11:06:05 +0300 Message-Id: <20230331080605.42961-1-den-plotnikov@yandex-team.ru> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Static code analyzer complains to unchecked return value. It seems that pci_reset_function return something meaningful only if "reset_methods" is set. Even if reset_methods isn't used check the return value to avoid possible bugs leading to undefined behavior in the future. Signed-off-by: Denis Plotnikov --- drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c index 87f76bac2e463..39ecfc1a1dbd0 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c @@ -628,7 +628,9 @@ int qlcnic_fw_create_ctx(struct qlcnic_adapter *dev) int i, err, ring; if (dev->flags & QLCNIC_NEED_FLR) { - pci_reset_function(dev->pdev); + err = pci_reset_function(dev->pdev); + if (err && err != -ENOTTY) + return err; dev->flags &= ~QLCNIC_NEED_FLR; } -- 2.25.1