Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2319304pxb; Mon, 20 Sep 2021 18:42:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXrookNm6mln6CkJa3eVSfJl6zW2A0slbOPMrIh3YFIWoK7Pfeq42ILO1ZLzYa20Jw4cvc X-Received: by 2002:a05:6e02:2148:: with SMTP id d8mr19373265ilv.305.1632188539650; Mon, 20 Sep 2021 18:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188539; cv=none; d=google.com; s=arc-20160816; b=MFq2NwOzDS/SnyXW1nvsrCAZZsweAm744RooE8krXbemobQGhZ1lVhVNYxK0rvMdNS trmExj2vQnSlHhZbfFXp/2IpaPaN9IRBcTqM2qnWyirfq16ceBq69qbeo/2vCaih6xhL jbyJWfFepJKXCZ36WSCjPNIVSGsGJXg2SUXcbo5H6TTCVABrKh//JmOdhtrUnFzI1+z+ 8E1j/VfalDvSOvCIYEVUJfsFj5iIEB19Toi+Hvg3xvm+FFD51Lx7/1dVYSEGe3ts5vHC hAC57uruVvfDI8DZTfDwBF0a00skWqIHkvwoDv1CnXuKrgzu3fEJjt2rnKai7/CriVMm gZ1Q== 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=NjT7BnLWg81mHvmsUoUNOI7LGVyhaJjBMe8I6+sHhNM=; b=RN+v6vsn4Iisw5Wmw60X24aIy2gqzUMuVTZIJUXx6NEEN/1ybAcqgLw6GK9Zvt8olj +WGkbbugpPDzCPACXKFbUUNJIc4iffFeTe6E+HUkRl0+cQGnHiSyicC4+UL1GX/8mxq4 e2x9mOCCxpZyFQtweG+lJJWOoZQulo8mgXTbTwNW++k9oZ18E0qryaZ7Tc9/k9eHF98J qO+wrSns4R/QEqT4LwO7i9hNSyIpXP/RfeCGNpnGFQLzX+ZTiDGEhFUpwCEtqV1EPgRg jGTc19KQYUZoh8jp0J+qeFjOqj14m1yvwN5z4k8w3LYggwB7duUFvw7b8kcTSnGlqLJf LxCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RveQDywj; 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 g22si1646737jaq.118.2021.09.20.18.42.08; Mon, 20 Sep 2021 18:42:19 -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=RveQDywj; 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 S243882AbhITQxR (ORCPT + 99 others); Mon, 20 Sep 2021 12:53:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:37492 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244343AbhITQuG (ORCPT ); Mon, 20 Sep 2021 12:50:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2A9936127A; Mon, 20 Sep 2021 16:48:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632156519; bh=BEdHrqnaRumpSH1/KUdNA/axJLqGlsErWO+bLDxSrxc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RveQDywjkYIhOYflohE+WaJKJjAOKOnZ1wvnSMrqMvLn/HE/DUPSw/IGM/tlmckNb vOwFhzdIDSoOS670YAWnjjJmPp0x/kOkf0qysMiMN/U933jlV88j8F65npddJg9BUE cT512TcRPAt2nu6nDAOcdLXXbpgDq9yu86x1ujPc= 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 4.4 055/133] usb: phy: tahvo: add IRQ check Date: Mon, 20 Sep 2021 18:42:13 +0200 Message-Id: <20210920163914.447595907@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163912.603434365@linuxfoundation.org> References: <20210920163912.603434365@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 335a1ef35224..ec86eedd789b 100644 --- a/drivers/usb/phy/phy-tahvo.c +++ b/drivers/usb/phy/phy-tahvo.c @@ -404,7 +404,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