Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3175717pxp; Mon, 14 Mar 2022 12:33:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWxOWn9K+Uny4EE3EhaoG3meoYEC6gedhgT/dLUpT6gYcfLAgXbLZpoMPd61paUgOsRROv X-Received: by 2002:aa7:dc0b:0:b0:413:ce06:898e with SMTP id b11-20020aa7dc0b000000b00413ce06898emr22170861edu.244.1647286433286; Mon, 14 Mar 2022 12:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647286433; cv=none; d=google.com; s=arc-20160816; b=SMQV9qeD/5v060MyZPiZAQgLeS96vYnANOTusEjGJJJbwd5SnNImfB4fDU+Eydo5xM YYAkcVhkTji9mP0soKaOyLOpmpdoGQl2JH4A2wAPS3cBm7xYZ2fm32l0NmndviVVUKZ4 7qNv9Yr0YJSCQ2ZfypPju/2Lv1mGNFs4Z5ln1zhq9L42+ViBGx/Ep20iKayAPbZG91Kf ZClP9FjykSJLYeRqOuv+UHm0P+DSofZWMqJCUk5oImIplWMLzbFpjY5uikeAFEburVI+ iDEWx+qU1fv8j6cPYx/mvegDKhJpcwal5Y1fSXq1ofZBzxtrPCmFW/+UyR0QVL/x3nKt Lo1w== 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=SEt0+UNC6PfW83gNiLjqUjwCMGXkMbYFUHRAvwHz+oixQO0atktolPjEljB6MTfywV O0xPK3GtkWHTGRbfL3jU+v3/v3FBpNeIHsyf7pbLu/EOONhvyi3nr8MZT3GTUGmVPP7g 8TYU/a5G5eVFaD6pEQ0DkdeQPZizkee/0dKweggqbb+If+PqATClCva2+u/1jn3CXEq3 ltUYkKt8mhZVBme1+WcwQN2iIh28x6QFOqQa3HbXb4Kzy+IJSYdVY//JU/Vis9dVQ2pr aNZlGO20vMaXo752sf2Y5BEIGw9qqQ6teocli+DYJArzB1uLm9LkdM+Ia8VrLADUV5tD qR4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1TGXYLMo; 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 y17-20020a056402441100b00412f4a296aesi14045445eda.174.2022.03.14.12.33.26; Mon, 14 Mar 2022 12:33:53 -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=1TGXYLMo; 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 S236664AbiCNMMA (ORCPT + 99 others); Mon, 14 Mar 2022 08:12:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241244AbiCNMI3 (ORCPT ); Mon, 14 Mar 2022 08:08:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C6064B1CE; Mon, 14 Mar 2022 05:04:48 -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 dfw.source.kernel.org (Postfix) with ESMTPS id A20616130A; Mon, 14 Mar 2022 12:04:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85CEDC340ED; Mon, 14 Mar 2022 12:04:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647259487; bh=+E5woosn/ZbFLikndWdbKLVKptItEm0e3E0i3Z+4g/Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1TGXYLMoh1xof65JjsJUlB7X6jv9HHeb8c6W/dy1tkvb3SaKlygATE1BCl3TFxzto LeYjp9JZpod350LNnvkSq9szofVZODvn6ChnFJqTVO8/48Z3rWpVdudMYsnKQegqjx n5/fFlsUXqCZhBKTaJZ63Nd4DidLUde5XOAuDaE8= 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.15 018/110] isdn: hfcpci: check the return value of dma_set_mask() in setup_hw() Date: Mon, 14 Mar 2022 12:53:20 +0100 Message-Id: <20220314112743.544081971@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112743.029192918@linuxfoundation.org> References: <20220314112743.029192918@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