Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9112644pxu; Mon, 28 Dec 2020 06:59:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtdHf2C4D/+nPHsLMGR1/ewqrM984CE0KTLj4ZMQufHo52dXerPL48ohdhj9yno7RfnOuf X-Received: by 2002:a17:906:b082:: with SMTP id x2mr38841217ejy.100.1609167563230; Mon, 28 Dec 2020 06:59:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609167563; cv=none; d=google.com; s=arc-20160816; b=vgiY39QrIB+s7jWiF9wsksg5navaXMMMtACbCV2/1Bf/XcNyJTtojKFJzBh3Y5b8Je 0Gib2LvbzSVBpJttB+XFjdEF83+WVI9uUvUkWRpfIxWOOnghrrZlrI+57vwOhimKYsjn 86WLmU2gqnD+CxtCr7V9a032Ml0iSTT52k/LK3DDpGaxosrzGprO9c2GO+Aua48PipCS BnSEekhrT5kHF2HStJMFQeZKxWcmzMiowBu3EK7zTAFgsiVYncgmlRqkxOS6/XnnQeJj y0Pe39TtAfltshswEQ+vFHHz6NyxSe9ReH8MEpQjxQ3KqfIjVHqEbKRp1eMz8b/KCUXb YXZg== 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=2MHFTjEEqP2cRCN8QIT51UsX4vqT8rA6GK04HPxkDGE=; b=Bvzr+AaH6M028FQqM/4xygP6Vt+E8+Xm2zzKQz67IgOjTDWiRngRzCGTPIHnhrCYV6 MU5LY2/TfldbxhH4B9AwOv7agyN1veBPK+zOCjmD5Zy5fH3XqJaPa382X8PKJZk5X8gf tJNFV121QFEuV5c+HiNDQdKgtgZRfeQZ/ce/olNR2rnmeNp2iyeT83m2TQztYPtkczhl ZQ6Ms+7adynQNrtLYw0tyT+C68ZY4XLuvdIjDhJsZzQUhbV3eXTwjs/2N5Y+Y4AqHH/P HGpLbIF6ATD0AKxwmfDBLjJyUG0sDCEfsHiEfJBZvLVUGowPO+e8Ox/WC2LkCNr6sOvu sWAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2rsSAd99; 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 t6si21305013edt.513.2020.12.28.06.58.59; Mon, 28 Dec 2020 06:59:23 -0800 (PST) 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=2rsSAd99; 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 S2441355AbgL1ORH (ORCPT + 99 others); Mon, 28 Dec 2020 09:17:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:51268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2441258AbgL1OQu (ORCPT ); Mon, 28 Dec 2020 09:16:50 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2224120731; Mon, 28 Dec 2020 14:16:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164994; bh=fGdpDe3GdEdKv7k2MsyEgHarQQpAdk+OfVeTJVA5oiM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2rsSAd99zzffjxCgS7247cqmVZlWL0yQBKx/2DahtNL2IZYlw6zdwh+bzD8fcCx6Z WbeTHF5FOI+5nB8ygcweeFXJrcYoxufbPSW/8JgAg+yoEgg1OBnaSm/j2CdCt40w+5 f+GktjbAPJCv8tQlJLyvatDDn1VNDbvyYPtD37MI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhang Changzhong , Kalle Valo , Sasha Levin Subject: [PATCH 5.10 345/717] adm8211: fix error return code in adm8211_probe() Date: Mon, 28 Dec 2020 13:45:43 +0100 Message-Id: <20201228125037.555923763@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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: Zhang Changzhong [ Upstream commit 05c2a61d69ea306e891884a86486e1ef37c4b78d ] Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: cc0b88cf5ecf ("[PATCH] Add adm8211 802.11b wireless driver") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1607071638-33619-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Sasha Levin --- drivers/net/wireless/admtek/adm8211.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/admtek/adm8211.c b/drivers/net/wireless/admtek/adm8211.c index 5cf2045fadeff..c41e72508d3db 100644 --- a/drivers/net/wireless/admtek/adm8211.c +++ b/drivers/net/wireless/admtek/adm8211.c @@ -1796,6 +1796,7 @@ static int adm8211_probe(struct pci_dev *pdev, if (io_len < 256 || mem_len < 1024) { printk(KERN_ERR "%s (adm8211): Too short PCI resources\n", pci_name(pdev)); + err = -ENOMEM; goto err_disable_pdev; } @@ -1805,6 +1806,7 @@ static int adm8211_probe(struct pci_dev *pdev, if (reg != ADM8211_SIG1 && reg != ADM8211_SIG2) { printk(KERN_ERR "%s (adm8211): Invalid signature (0x%x)\n", pci_name(pdev), reg); + err = -EINVAL; goto err_disable_pdev; } @@ -1815,8 +1817,8 @@ static int adm8211_probe(struct pci_dev *pdev, return err; /* someone else grabbed it? don't disable it */ } - if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)) || - dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32))) { + err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); + if (err) { printk(KERN_ERR "%s (adm8211): No suitable DMA available\n", pci_name(pdev)); goto err_free_reg; -- 2.27.0