Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3579186pxb; Mon, 24 Jan 2022 12:41:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1BEffo+jy3FH2NiWq8SPaHeFJGAS9n9Theamh0LpK+X+tkoc3yVviRhLWm+w+eobnqLD+ X-Received: by 2002:a17:90a:4594:: with SMTP id v20mr88464pjg.105.1643056898254; Mon, 24 Jan 2022 12:41:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056898; cv=none; d=google.com; s=arc-20160816; b=zuSYRs460AtRvcxM55ov6hi/XJMCiSkJKHY0FAsmWY9AJBfadKZs0NZDZnHq0WjyUW ovuSbzWEneR3mbCmcZQxhKBYFV28fiGk05wliOcLH3tj/JoJ8BSeR1E5SqglCW4+OxFz 9UiemvQaqgF3wduK3h4I/rUu+VhI4XEEWkYcdXeu+CMWk4Wu8HIL68sf7uwJlmF3+is/ mBMbFYIONbUVuFW8ceZN8L3sLRIdP469bhvPaE3a1qjTyVWfWoEkNMeWvSgXvnM8f8X+ /NVxlKXvMB/nPOsIVqSvypeh6BzgKViR3k7xF9aguVQUApZP3Sc19HxUWlkxuQw0miTh jpwQ== 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=x8U0V5ulOmVGBB53y8XiPu3V/Rigpx83JfE83LcIcbo=; b=pXqxBHNLRrypZ2/5yx9WBCFVDIoyDzv+VSznHWQSyA2nW984LsOGy7ubv/lfU6EQUW sdMNzJVy/ImRtB43IPDR7a9Rbb2qVmAzqiQpWLxAeR2JkdcgK2qRYKuK/oJBUS6WNNpL rdA8FyTCbT9BtCE6bR/nGJGcnov/Xx1bZdJNJ9ptB2NoWUJajuXSoeyH8TcCDxcXfRha wBUYuuETI3bmtpWQEYFovcgH+zsHtt838Kx62SazgouNEElxWYqRDPl+0P4X4JfDiUMu LGRZYn0xMUH++RYPaTsq14wcMAMT5vL502pIB2np5kMYl5aGYQQ93OiuXI50LFtjSvfe b2FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bblztRuS; 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 c7si12781492pfr.274.2022.01.24.12.41.22; Mon, 24 Jan 2022 12:41: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=bblztRuS; 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 S1352069AbiAXT5I (ORCPT + 99 others); Mon, 24 Jan 2022 14:57:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354010AbiAXTfp (ORCPT ); Mon, 24 Jan 2022 14:35:45 -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 9DF32C0617AA; Mon, 24 Jan 2022 11:16:43 -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 671B6B8122C; Mon, 24 Jan 2022 19:16:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92956C340E5; Mon, 24 Jan 2022 19:16:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051801; bh=g8ixSqcY0Ao9RXrC+KAENnCMRhstpUIFshIN3sXklTI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bblztRuS100v773T8Ni+xkQBhQNPHXplsNoXhLBHIlW4pBm9hTgBJJ2OUe96MQOel frdaTtCZ9uzSNFMhOqFomjmNaBBnY9matu/WJVUfFDhB0GtyIW8IOGavMPyQD5LMc6 juODxCTeyJGvPDv9tvtEsQAZzshwVC6+OKpsGwks= 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 4.19 091/239] Bluetooth: hci_bcm: Check for error irq Date: Mon, 24 Jan 2022 19:42:09 +0100 Message-Id: <20220124183946.010461138@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183943.102762895@linuxfoundation.org> References: <20220124183943.102762895@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 3e386f68faa02..1a298f13bcc87 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -1052,7 +1052,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