Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1832513pxb; Mon, 13 Sep 2021 06:32:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrxITBVYhPkl/fI+BygFEqR2qpi60JoZjlrZUrXoK4cF2bqrERmXoM+vGyXbu4VRmaggMW X-Received: by 2002:a92:6a06:: with SMTP id f6mr8175891ilc.16.1631539971120; Mon, 13 Sep 2021 06:32:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631539971; cv=none; d=google.com; s=arc-20160816; b=jnysNEGNjUFdn8FO1fr43Pnb5MFxKPXiWBnkar+RHNxLNibYk+F8M/4rZWEeio5j6m LvCVZ/V2BwwDMjTQk15oPausiXapEIofphEEYbIj1NiG+NGrN02f8CMYWbGnFUAwSbV5 3orY+rBprKp96CJC6bM60engq64mF8tBd8YusDufFPlQRJruveiVlFKFMPA25CHtzaAI cQ3s6OaARJiAq28EDLVLn89XEgv+/U0mGdQsAMCHkC0tlhRfr3ntha4IvGd6KMmElo/h mFqEcieZRV1IcIFwqTLA/uwTE47eflLAHdsAbviRqdR7tIxSiMp8qQi6PwL4pVprVS2Z gz0w== 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=KMj7dzBboem1KiIt5xXgbioSO/+JA4o/zpKUtN4bDiTcPH0oC+RjkBQBF5FjCc5US9 GtmhXVJwihJTUyW3aSVB5gvByJKsLuR1leKyg6SgLc4Go8y9bADZ8H1ZsvGJwingjeMK ibncNJb9No5DfBN4eyXbTWqPEdOwxQWw1YQR905p/fog6dQaKxSZVba6xw5tqnJEzqwy OqqKn7gJ3rSK6T7DfAY7Gp/Nw0sDRFSs4iG3pxsja0/uWz/iunl3swjdup8DH0yYyct5 jVmLOkKayA/Aavtnv0amay5bAbjkMDWOyG8ORMx4aMO6pBh7dDMA2SZjDNb4OxinUqCf wK7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FjBjEwob; 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 z17si6610591ils.47.2021.09.13.06.32.38; Mon, 13 Sep 2021 06:32:51 -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=FjBjEwob; 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 S240491AbhIMNci (ORCPT + 99 others); Mon, 13 Sep 2021 09:32:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:37510 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241448AbhIMNYO (ORCPT ); Mon, 13 Sep 2021 09:24:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D074F61108; Mon, 13 Sep 2021 13:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539311; bh=d9tOvY4GPK1jKWMaBSPHaYQUFYgLGzNJbCmnl5KHBLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FjBjEwobABBPBRHH46doyB/K2MG+RdrEYrTKmhc2+Nxyob74z9/DX2s48X0LLLyXX tO9DAl8P4AuBTBzOjGuZ1q+qLn/efi4Y7PzgZQCdbR/fEQ7FhBDXg3wTUjbQXHpkTb BgZoDfM635cOtwoInN0jLQpqm3GMD6llHf/Mc0KU= 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.4 094/144] usb: phy: tahvo: add IRQ check Date: Mon, 13 Sep 2021 15:14:35 +0200 Message-Id: <20210913131051.090308396@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131047.974309396@linuxfoundation.org> References: <20210913131047.974309396@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