Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp67203pxb; Mon, 13 Sep 2021 13:07:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0hGes1FcJ6JSdwFqxza00Ts5Rb3FSGgAcP7xqbhhaO+/ZjpkDzOjrpKDoYMg5uOaay1r1 X-Received: by 2002:a05:6402:45:: with SMTP id f5mr15436415edu.68.1631563657866; Mon, 13 Sep 2021 13:07:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631563657; cv=none; d=google.com; s=arc-20160816; b=UKSZyoEnxV26MFmCKV/8kSBxIZ0wVQ27iVGuBST73sik21I3IXBqXFHzYkqoW0iXH2 +iF9pBOqExwKws1tpycGRfWvnTc+4iEqHA5H7HBPdHnljvm/gZYSt9lUSWIIrmlqzDA6 KYEceTDyrWCl1ts5+C1lJWNOJkDFIDOBK/7+W+4Zi+r3YrAY3ELqhHXwReYMEljW5Ob1 +kllkaItihq6USgIuxKj+19Po/NTpbyyQE5QWU7p7M0sWdx/+mnkuZHJ/G34m4Y6V4Vh FSReIUJ+36t8UMGWeyB43OorsZKMnXIPpBfizblaGrV6rAzFPKveIPQ+GNoADir3bNHx I3Jw== 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=GyM9PyyzxlG6zPv1P2QnsIcX9ZFStq4s+WVo3qSN0e80gJX3k2Tjl+8fOZCr4f5o9n jjnZ5mhjmkoGQWhwSeO/iX3T917sySG74K6ky0JkKWomAOC1T68jSmSuauUNykDcfhRi tItbGKbR3K324PeeaYo0dMXX1o3iin9WjXLyGk3BRfD6tJafNQrx1fkVWnqlkB3X2i1z tyjNXywus/E9oKXW90LfVffg1BxYVcp/q/KlutsjrSY+w+KMhhJIY0ah3HN8wz+6KJ3I /XR1dthu7wEryth7/zab+ocQTsuwjVpGbhSQlXYVSyetZv063odM1Eyo7XTDkzRimAEz Rf9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ULGIAdaq; 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 g8si10618927eds.50.2021.09.13.13.07.09; Mon, 13 Sep 2021 13:07:37 -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=ULGIAdaq; 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 S242367AbhIMNqi (ORCPT + 99 others); Mon, 13 Sep 2021 09:46:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:41932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242947AbhIMNlO (ORCPT ); Mon, 13 Sep 2021 09:41:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 370D76128B; Mon, 13 Sep 2021 13:29:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539786; bh=d9tOvY4GPK1jKWMaBSPHaYQUFYgLGzNJbCmnl5KHBLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ULGIAdaqJK2gZAqEZDAYCT5dX6WsAHUZVtAzvMqLy+AyZ8+FNJdNv62Z9/psuxgmb 5gMU1L8XvSNXuBtL35R4LMespXyL5rOK/MNqpqE1J3v3sweb0Gli3GpRAEC1RrCw4L 5WOFn8dEqC6exQqpcAfqPVbP11QQp+Mf/73Ul004= 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.10 160/236] usb: phy: tahvo: add IRQ check Date: Mon, 13 Sep 2021 15:14:25 +0200 Message-Id: <20210913131105.830506534@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@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