Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3589300pxb; Mon, 24 Jan 2022 12:58:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYK746E0H5zS/oU6zCvBmg1W6m8GDzgOODynQreqneBN4pj6ftRoUyqeCSRMNnjIJ7JfOv X-Received: by 2002:a65:578b:: with SMTP id b11mr4971177pgr.318.1643057892424; Mon, 24 Jan 2022 12:58:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643057892; cv=none; d=google.com; s=arc-20160816; b=vlC/FyARUw3fB82PV5hWgUFzKmCMIUupBH3obe4HYC/Kt2ohqOxDit8sdVMSlPyhwE blFud/vW6Eme0l2E4Zg25fWNyvlAFumlDBpoL8Jm+xddPW+JVDijC9fCjtUGTl+MOUaY lVFOfRyDlWuhBy6DaGAPjE6Wbc1uDzm+2QQuDJ0OTTQ0NZsWqySznaPBtSua2+7syeZl VMFahtFB1Na4gYREU6cbwIdR4F/1qPvoSBLDholzOEZZ+Juqwo/KjDfv4hWDPCEVlSj0 EpTca3O3gd4jNiKYR+9V+d7oylzSyUfY8fnPGtuPzRgrgjwvLFY89bSBHVG0UiiJfuxQ jTog== 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=0LfhnUhX6CoSLQVfvkezyM/WqyQLSqJVC6cnDuswXz8=; b=E8VYt+j2/5XmudMmcl84hT8HMFK752qww2/gbcgLuAEm4ou4LkDu2CKukmjPoHjF9T AFbkgk5/0Dr+O5OwskePyMeUaAGmp9Cm0OF3aZE/eUQ+fT0MVj5X3IXvpohJpqic77S5 p6DMwsQaIZROCI82378u56nh5NRctto+ZnH980KgtBAIZ6sH+plyCveU1OQISMwMb/rw UC28B9tWASwoquR8AEICCJMgiaa7UD0gY2GSPfTGpvg9aR5IwPCG7HifOcRWgpPY9Zzc vj2Eizm5fe46YobhKtGAnTQDB43vfH5CzrjUObN2kJs4C42Dl9E83OGLFNQd8tBexPlE KmXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SJmM+oGc; 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 z12si16004797pgu.689.2022.01.24.12.57.59; Mon, 24 Jan 2022 12:58:12 -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=SJmM+oGc; 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 S1356905AbiAXUVj (ORCPT + 99 others); Mon, 24 Jan 2022 15:21:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376679AbiAXUDd (ORCPT ); Mon, 24 Jan 2022 15:03:33 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 055D2C08E6DC; Mon, 24 Jan 2022 11:29:44 -0800 (PST) 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 B7B28B81238; Mon, 24 Jan 2022 19:29:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4820C340E5; Mon, 24 Jan 2022 19:29:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052581; bh=J8duQaotuAl4FUUuOIClzvWBYiFdiRFM92W/pHtQcoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SJmM+oGcqZ0BG+Ym7hvZlF3eRAAxm9HG+6F+1DxrFKAFbLab2lljYwjPoWhzc6PPv pRExZGqps2tmTp3tzPNZ15RUAluIzj5v8PvqEA15qZwldYbCU5DzHu6PtZwmvUFP9I gQVUznnK8H6FsxYsebs5yAhAWd5zp/iErJnG5iAQ= 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.4 107/320] Bluetooth: hci_bcm: Check for error irq Date: Mon, 24 Jan 2022 19:41:31 +0100 Message-Id: <20220124183957.360997824@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@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 94ed734c1d7eb..c6bb380806f9b 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -1127,7 +1127,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; if (has_acpi_companion(&pdev->dev)) { ret = bcm_acpi_probe(dev); -- 2.34.1