Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3709119pxp; Tue, 15 Mar 2022 04:53:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7+uZ//GrSewOuWCVp5j3KMcbQR2O2+YLQOhZT3Sx/A6wqCl7F5ugrFrxzl878mvlqFM2B X-Received: by 2002:a17:902:8203:b0:153:2e8:aaae with SMTP id x3-20020a170902820300b0015302e8aaaemr27505715pln.14.1647345188120; Tue, 15 Mar 2022 04:53:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647345188; cv=none; d=google.com; s=arc-20160816; b=ia/iGIj4YS0Yg87OcDMSgrPBEo7t+M7GdPDMz5PXLdLLE8mcVfEdqHrsnV9d0fmvOC 5YQTz7JboM1GzYaJPc+bH+8q3mNnB8BRPyJ5aMlq+IifS1XrNaAcOWU2qCTYpGxCDjv4 Ro8buJFQYs7ZDX0U+aYtmqW0DR3cayCDhW0uUvHLUEQLCAaAc/a+0pwURpS67U+y2WW4 OvVWBIT7L0XfLuvOh+XDMvzqI/oKbeODll0LcOnvnpBg6syNXEG7blzgcVGH8pdMCZBb ygl8AAQLPgQ04VX1VThAY6T2sbzVmOE8rWEfwjBf6rjjPUrrlpkeqngsjEdDD/beZdLl vq9w== 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=sO85GCZ112Aq1CMd8ASwaqScJI8RBcYp0CK9EDoob6Q=; b=T1iDm1NktO8bNxcODQMhpHdcJ48V8jiwALKj/FdrtG56+n6DJ9JcOglLOszQOHrUPG GlBxj5sGNeJ+FOPMDgySj8CwAQVQ3IkRqxIOxGYhG1jxnyDcmAFyx1i4neG49NqFgfyA 7SdR/g9bd5SfPD/knLidHwT+JSouM6vAcMDoxQngHG0gxOkN5RQcKyaSJM7cU6N/TuVl Wiwj8rWU/efrbfszz3UDkFAeajRdzQ3VYA/LOb3SOcZi2DD1a941RpeC/SN4M++wNUlv lildVXGiOhIBV1rggNS/wlt4c9msDchej9YkbEtxiVGmm5kT3Q87cs2o4r+nt9TB9qB8 mB2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wPmMm4hk; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020a170902d49100b00153a66765f5si608005plg.368.2022.03.15.04.52.56; Tue, 15 Mar 2022 04:53:08 -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=@linuxfoundation.org header.s=korg header.b=wPmMm4hk; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241546AbiCNM0e (ORCPT + 99 others); Mon, 14 Mar 2022 08:26:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242372AbiCNMS6 (ORCPT ); Mon, 14 Mar 2022 08:18:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA12A4B84F; Mon, 14 Mar 2022 05:14:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7E6D0B80DE1; Mon, 14 Mar 2022 12:13:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CDFF1C340E9; Mon, 14 Mar 2022 12:13:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647260037; bh=+E5woosn/ZbFLikndWdbKLVKptItEm0e3E0i3Z+4g/Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wPmMm4hkK2yJadkwxKDeW6Y6e4nyRi3FXoHW68tvJQ/EJj66WH1lCtMdLn10ssCdw RCrweHb4QunqFz885arU0WQlDu5V7vAL/oW57T+Tf6jiLTXZYwHFl9AMtznPume5li 6kgUbDe2drpLLa1b1Gfj7nMoVs8oifrfBfqkPrfE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, TOTE Robot , Jia-Ju Bai , "David S. Miller" , Sasha Levin Subject: [PATCH 5.16 021/121] isdn: hfcpci: check the return value of dma_set_mask() in setup_hw() Date: Mon, 14 Mar 2022 12:53:24 +0100 Message-Id: <20220314112744.720289318@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112744.120491875@linuxfoundation.org> References: <20220314112744.120491875@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org From: Jia-Ju Bai [ Upstream commit d0aeb0d4a3f7d2a0df7e9545892bbeede8f2ac7e ] The function dma_set_mask() in setup_hw() can fail, so its return value should be checked. Fixes: 1700fe1a10dc ("Add mISDN HFC PCI driver") Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/isdn/hardware/mISDN/hfcpci.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c index bd087cca1c1d..af17459c1a5c 100644 --- a/drivers/isdn/hardware/mISDN/hfcpci.c +++ b/drivers/isdn/hardware/mISDN/hfcpci.c @@ -2005,7 +2005,11 @@ setup_hw(struct hfc_pci *hc) } /* Allocate memory for FIFOS */ /* the memory needs to be on a 32k boundary within the first 4G */ - dma_set_mask(&hc->pdev->dev, 0xFFFF8000); + if (dma_set_mask(&hc->pdev->dev, 0xFFFF8000)) { + printk(KERN_WARNING + "HFC-PCI: No usable DMA configuration!\n"); + return -EIO; + } buffer = dma_alloc_coherent(&hc->pdev->dev, 0x8000, &hc->hw.dmahandle, GFP_KERNEL); /* We silently assume the address is okay if nonzero */ -- 2.34.1