Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3601092pxb; Mon, 24 Jan 2022 13:14:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwuVRvhio1PXqNQuBDG5oMlyOODekI2UoNWqlfAIyek1911OcBv5YRhMLMBB+jHl0RthlGc X-Received: by 2002:a63:7d42:: with SMTP id m2mr13136040pgn.491.1643058878078; Mon, 24 Jan 2022 13:14:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643058878; cv=none; d=google.com; s=arc-20160816; b=TlcveHjyjxHPRd8od1iXY1hdrnZy934cKk+z2hOysAJBPxT8PxXgRRy+skVAcYqB3E ItbbcBCVkVUe39L4nwcmMFYhL72/vGPfPSu6jA3nvAUNFoyGz+N28p7MFGtqjUC1bFeU GmA5p4NHLvXzEzGoZJzg+5CfGyRU5AyStiTSr4maYKs5g0pCL2mE8px8T4qVssqQXw2A HKexA8vnqozrq+TY3zvyZKac6R+NvEjoOTXaZc0Mp4BbaF20C/M5Nvsn01TIGjNUc5o9 x+ihiGPHKQwWX7S+l9+MW5B4qMBVX8n4X0YRdaAtJWEFwLfYlogylH6uHgG8KU4GASM8 K4Ig== 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=P270tn/ZEy8ZWy8C2fuZV2XzXFcA/PyDX1jo7na4gKw=; b=TLCC1/xXe8CLn7Txzs5SYEkpA7AvKIvL3swLVdkI9wCRz0H631tLc/kh8sZ7BNC1PE 3QqM2dIMMcvZ/RJbw5MOLQvyp+L6BddutFt1DBohm7E7o7RXFoYmCFs2qXQMpChqiE/X YdKLYfz335gC+knDZx2CaATyCTr62AXY1htZ1bYnRlf3DeCB6xqrGWP+Qic74/nwu1jD 5GuwKChIorZcKEv97mmQJSf0SYduob9YPc/wH41q8W0EFe2UqscHqDw8GNrSbdQUsMRz 2zOLrPrCTG3qcbuHi/HSXJe4CswcPJpN2P6kY7MhiQPW/agLWnrm0k3XooG+LpIZrJn3 ZMeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Og2RYtCo; 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 c9si13905282pls.63.2022.01.24.13.14.22; Mon, 24 Jan 2022 13:14:38 -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=Og2RYtCo; 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 S1390157AbiAXUo6 (ORCPT + 99 others); Mon, 24 Jan 2022 15:44:58 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:33896 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382612AbiAXU0A (ORCPT ); Mon, 24 Jan 2022 15:26:00 -0500 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 C1E20B80FA1; Mon, 24 Jan 2022 20:25:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1C70C340E5; Mon, 24 Jan 2022 20:25:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055957; bh=hMS3Pfo/RADStheTOI07FspzNnegx1/g9BH7Y01uFTg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Og2RYtCo8K+sybJg1dJVVtXUT0lt9DJEyNCuEpNoQa3Vi9FB9rNeImVBV0x2MVG74 Lvwd+1r2/Cg+qb7cxo2MM7HcQ94gdLW1mfxLcXDiOY4AH/p3Eb9Bd/npa8OVu/shSq mRdYZcx7l445YsFDFb/zjhGeh4IYueNkwykTl/B8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Marcel Holtmann , Sasha Levin Subject: [PATCH 5.15 321/846] Bluetooth: hci_bcm: Check for error irq Date: Mon, 24 Jan 2022 19:37:18 +0100 Message-Id: <20220124184111.973101950@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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: Jiasheng Jiang [ Upstream commit b38cd3b42fba66cc538edb9cf77e07881f43f8e2 ] For the possible failure of the platform_get_irq(), the returned irq could be error number and will finally cause the failure of the request_irq(). Consider that platform_get_irq() can now in certain cases return -EPROBE_DEFER, and the consequences of letting request_irq() effectively convert that into -EINVAL, even at probe time rather than later on. So it might be better to check just now. Fixes: 0395ffc1ee05 ("Bluetooth: hci_bcm: Add PM for BCM devices") Signed-off-by: Jiasheng Jiang Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/hci_bcm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index ef54afa293574..7abf99f0ee399 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -1188,7 +1188,12 @@ static int bcm_probe(struct platform_device *pdev) return -ENOMEM; dev->dev = &pdev->dev; - dev->irq = platform_get_irq(pdev, 0); + + ret = platform_get_irq(pdev, 0); + if (ret < 0) + return ret; + + dev->irq = ret; /* Initialize routing field to an unused value */ dev->pcm_int_params[0] = 0xff; -- 2.34.1