Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp997202rwd; Wed, 7 Jun 2023 09:31:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7uLMN2A/SV3FIkWgTVYBXhabC3iznBOwj5i7XvlhCoSh7xUjSe/IOzzO9KGS/paxr3Bv49 X-Received: by 2002:a05:6a20:7fa5:b0:10c:67c9:2fda with SMTP id d37-20020a056a207fa500b0010c67c92fdamr2443112pzj.40.1686155490515; Wed, 07 Jun 2023 09:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686155490; cv=none; d=google.com; s=arc-20160816; b=KFQc4hLy5tjKyoMMdf1v8q6oXrEE842qXibYHv1Ib94r+jAa7A/fCDvPjXVrrR7PS0 yPDR50sqwmI6WkJXyxiNdbb9f/BgayHuQqJBv9TrsfiUx9wDQ3jVb1cIw0Oy47VVOaVg x9cq309wvf3FCSLEoOu2kvGXTWP/4NT9EDC25jYDd/HGI2xaO/CsEIanSRdOQI2nA8jr jlQ8gG+TX8odrGO4d83blOaZWFUzF/vP6L+sZ7DBQXazbg4VVb6wBJ7fmySn88Wo7J3C PMMBY20fBUKvYCXMEsAUE+P1AmK3iRLNVfoVmuNJ/jxDU9ntS4CGWYLKfYOPJcBF8dMB U22Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cZjh3SNsHicEetTbgG/03B9ec8uS3ctpisatKaG6ePU=; b=vq2fqbSIQZzNVGH1QgWRLn2+LXU15gjaFc9gbgcI/GPBlonFPrv4erN69InaQKDEzC 02KsBHcrazqPlQyUP61D8wSOCIYqkLvuA6AmZsWEKNwxmEWyA7ZFUgAQEPU6pubnxOaq Xo7hk4dpYcvwXHc5VONJhU3kXf4rA9WOPgrKvrWceC9uMPs/EMel4rxqyTjQ/Le4iVxp PVc7816dphnRudBZWjmCpk2/J1Z6EIIRgaS2NtOIpioUUA+AO9a8L7bZqSBS0+Ht6vc5 PFXzHdFLcTLAK1bulQSI1XgXYNGqi639MtA7L/VPfjLI/845Vctj5fUoZ/6Y0lFJY6XX GauA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=DOnLbSus; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a72-20020a63904b000000b00543ec36863asi3445665pge.898.2023.06.07.09.31.14; Wed, 07 Jun 2023 09:31:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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.ru header.s=mail header.b=DOnLbSus; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234874AbjFGQQo (ORCPT + 61 others); Wed, 7 Jun 2023 12:16:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233679AbjFGQQm (ORCPT ); Wed, 7 Jun 2023 12:16:42 -0400 Received: from forward101c.mail.yandex.net (forward101c.mail.yandex.net [IPv6:2a02:6b8:c03:500:1:45:d181:d101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DE6F1BF8 for ; Wed, 7 Jun 2023 09:16:40 -0700 (PDT) Received: from mail-nwsmtp-smtp-production-main-63.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-63.sas.yp-c.yandex.net [IPv6:2a02:6b8:c14:6e01:0:640:627f:0]) by forward101c.mail.yandex.net (Yandex) with ESMTP id EF1C560045; Wed, 7 Jun 2023 19:16:38 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-63.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id KGX7fTADXSw0-rF2zrjxU; Wed, 07 Jun 2023 19:16:38 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1686154598; bh=cZjh3SNsHicEetTbgG/03B9ec8uS3ctpisatKaG6ePU=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=DOnLbSusrLhFJEVU5kDThvzwHvORI6dNFMvXebkKbRRwOcxwk2rl4jM4lKEuf3eVo R29AWfvczFYFdEebw4lXfAgI8TAcmu29LjUbbo0ZJvlPoPLOhcJysA8DWn9ZTmsbZ1 feaghkCzE9/NhW4358TirOt//QOc1cUp6+dKnfrk= Authentication-Results: mail-nwsmtp-smtp-production-main-63.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Dmitry Antipov To: Franky Lin Cc: brcm80211-dev-list.pdl@broadcom.com, linux-wireless@vger.kernel.org, Kalle Valo , lvc-project@linuxtesting.org, Dmitry Antipov Subject: [PATCH 3/3] wifi: brcmfmac: handle possible MSI enabling error Date: Wed, 7 Jun 2023 19:16:10 +0300 Message-Id: <20230607161611.85106-3-dmantipov@yandex.ru> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230607161611.85106-1-dmantipov@yandex.ru> References: <20230607161611.85106-1-dmantipov@yandex.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham 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-wireless@vger.kernel.org Handle possible 'pci_enable_msi()' error in 'brcmf_pcie_request_irq()', adjust related code. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov --- .../net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index 80220685f5e4..4d61f241cfaf 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -965,6 +965,7 @@ static irqreturn_t brcmf_pcie_isr_thread(int irq, void *arg) static int brcmf_pcie_request_irq(struct brcmf_pciedev_info *devinfo) { + int ret; struct pci_dev *pdev = devinfo->pdev; struct brcmf_bus *bus = dev_get_drvdata(&pdev->dev); @@ -972,16 +973,20 @@ static int brcmf_pcie_request_irq(struct brcmf_pciedev_info *devinfo) brcmf_dbg(PCIE, "Enter\n"); - pci_enable_msi(pdev); + ret = pci_enable_msi(pdev); + if (ret) + return ret; if (request_threaded_irq(pdev->irq, brcmf_pcie_quick_check_isr, brcmf_pcie_isr_thread, IRQF_SHARED, "brcmf_pcie_intr", devinfo)) { pci_disable_msi(pdev); brcmf_err(bus, "Failed to request IRQ %d\n", pdev->irq); - return -EIO; + ret = -EIO; + } else { + devinfo->irq_allocated = true; + ret = 0; } - devinfo->irq_allocated = true; - return 0; + return ret; } -- 2.40.1