Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp218275pxb; Mon, 13 Sep 2021 17:26:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsVX5MtcM2EqHueBpq3khjy8BLMbrQ8IphmCh49+ESJ+d9en+BFek1UQ3aKwsir39KBwrf X-Received: by 2002:a05:6e02:1d9e:: with SMTP id h30mr10463462ila.195.1631579200698; Mon, 13 Sep 2021 17:26:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631579200; cv=none; d=google.com; s=arc-20160816; b=hSBOIVuXD7xCNrg7pqGGwq9kxzw3M/XeRU/XSeM4JlIANTLrNU5b044TuABvoorc6Y pmp4L3T1KlsOoeA/4NJQ/Oe1puj11xNqw5lB4466ASX84Kgd65EmIEPXxitC15n5BrAm ubldjcRL249FZzrGTGX81+Y+Gt7OvoJYWxjd513eztEAAZ/oS2M0WvLmZAyErjPBQBDD TWVdpHxAM9EmdBW2tTJhiLEQ63r3Auf6/5PD2G4oCSs2HgrTNItslq7TlkRADjn51MGo Krss0fkYvtktj4H4EuEYBTbZY6PChucgei4lSB9TQj/5ic1eS7lQmPtI+SPc8xgmdAyS dDtQ== 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=VIfLI32ikmzSPWoBrrRLAqq9mxbq3MomW/ypafAQ9h8=; b=JoxiRReDK0R5IeGSlfyMVxdUohTo7QhEe2/wwRCeMhuMHO0z7LvnP+uME1jDdXAnyp ED20QRG4i/77rxvL76oQBVXbAYrgZMceV6DD28yDeoX8M9d/gUu3M9EoBnujxFVH+SWj DMSeK9Uy/m+pZhnIe2CQ8DGIZqu2P/Kmv6FT8TF/33EVSgEkIVMYwl5Xth2ac0B4t+HN Jr6wWeeH2S/7IH+S3IbWXcKz1Au0swtucyM6V8U9yvo9Xo3E8DhgsFZeIcAx7y5ag0kM J4jy3xbqflESyjLusthgiviDjKtr2NDxLxRdFk5SW50GZ/jHK1C/7BnK6+Blwg7qzBNB gdBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wKGTPzNl; 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 u20si8714268jao.113.2021.09.13.17.26.29; Mon, 13 Sep 2021 17:26:40 -0700 (PDT) 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=wKGTPzNl; 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 S1344368AbhIMOLV (ORCPT + 99 others); Mon, 13 Sep 2021 10:11:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:59954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344158AbhIMOIs (ORCPT ); Mon, 13 Sep 2021 10:08:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 39D0961283; Mon, 13 Sep 2021 13:40:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540457; bh=d9tOvY4GPK1jKWMaBSPHaYQUFYgLGzNJbCmnl5KHBLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wKGTPzNlgHxxJQdbl8EfZpKyUT8xqmM2Q9tEZI9dtEWpcneX8xHj5xL0rodtmZ1/A e8AzlMiGNUyIG5duEWk5ln8f/hipVU6TEy9LmpLmFDldmn/RqJfSyTe7w/wAzkO1Y3 p/N5CFyMRnPbDPeU/pO3/DVNJjXJdIEVpNL7GFEI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felipe Balbi , Sergey Shtylyov , Sasha Levin Subject: [PATCH 5.13 194/300] usb: phy: tahvo: add IRQ check Date: Mon, 13 Sep 2021 15:14:15 +0200 Message-Id: <20210913131115.933994984@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131109.253835823@linuxfoundation.org> References: <20210913131109.253835823@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: Sergey Shtylyov [ Upstream commit 0d45a1373e669880b8beaecc8765f44cb0241e47 ] The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to request_threaded_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original error code. Stop calling request_threaded_irq() with the invalid IRQ #s. Fixes: 9ba96ae5074c ("usb: omap1: Tahvo USB transceiver driver") Acked-by: Felipe Balbi Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/8280d6a4-8e9a-7cfe-1aa9-db586dc9afdf@omp.ru Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/phy/phy-tahvo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c index baebb1f5a973..a3e043e3e4aa 100644 --- a/drivers/usb/phy/phy-tahvo.c +++ b/drivers/usb/phy/phy-tahvo.c @@ -393,7 +393,9 @@ static int tahvo_usb_probe(struct platform_device *pdev) dev_set_drvdata(&pdev->dev, tu); - tu->irq = platform_get_irq(pdev, 0); + tu->irq = ret = platform_get_irq(pdev, 0); + if (ret < 0) + return ret; ret = request_threaded_irq(tu->irq, NULL, tahvo_usb_vbus_interrupt, IRQF_ONESHOT, "tahvo-vbus", tu); -- 2.30.2