Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp88906pxb; Mon, 13 Sep 2021 13:45:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD4tS5UnnrcUSIM8B1kMt8TdclUQETRebaLpvjrzH6FQtkX4Kj22vQMUlZMhQtC3eF2bOW X-Received: by 2002:a17:906:abd1:: with SMTP id kq17mr290799ejb.390.1631565920867; Mon, 13 Sep 2021 13:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631565920; cv=none; d=google.com; s=arc-20160816; b=YpIuMZ5w9d7XxODwx6lVQTmoRN5l4mZSkyE7WTzxuFLZH2Z0ZAAVfVze5oAAV89RQG jSVrP/aw+WCJahhB5Zke42pQK8AG4xBkcIoxSdoGWlhenC9aSMcQewLQ1+uPnRGazxwU 60XmPh9LEav10e883FrFnE5/FLwavAvG+qiuKuqc2dDg2K/9YG5GfHiw6ANhGzUr6L6F JLlngY+ETNfm1UuCb+F1V0j4/zOtzamlGOzYNZvVPZW8Ut2GJ3WNWYBJlBogqneMApq4 on5tHsQIQNbReJrfRE1NxpXVP7vmnLMOAD8y7h52xrB/22KRuCPrKItMSU42TN1fjgWQ Ja+Q== 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=+cnGWdWTx5EB6ecbHeWy1kej0MERJ/slFpRsAaDaK1w=; b=W8THa/q6741jbyuLtj4IOV6mfOFldml2wir8K1sAT4w5U7C6ZAAdTXMBoT/pltpzcE lIZKQFUhjcKkPu9SsgF6CAC09k9ciH9U0FceyRZzyyxIiVxkcfKbQqju6PKqnzhQm2yU oiSMVpCh0CKjKGEw4gsBSj0Ck1DEN69igamQDCaE+BcniDhnhNvR2PMtdJNRGHxDv07L N0lT2t5t8pzhFlutr64wnZNDcMP5wuSIqUYuFtagwVdbLAz9BzzSSc7mkNQElLc6uwBf 1FtJ1qhFuPrGcLx9haNx0kxaWT7+g8QhlI3Rpo07DL1fP+LQMnM+7VG5Ms6v7y85KbmD FAvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0Q2xrHSv; 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 g24si8717028edr.84.2021.09.13.13.44.56; Mon, 13 Sep 2021 13:45:20 -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=0Q2xrHSv; 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 S243983AbhIMNpH (ORCPT + 99 others); Mon, 13 Sep 2021 09:45:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:37818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241365AbhIMNkI (ORCPT ); Mon, 13 Sep 2021 09:40:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B404C613CF; Mon, 13 Sep 2021 13:29:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539761; bh=pjnJCroe+DxkfKrNgNYoolpkciWNle+1P5sU88pqt/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0Q2xrHSvnMOZf1+4QN/3yu5VZyWq+GHQBx8xsV+5G61uo7JUpnlzoYECByGWOMdkm SFHGQ2Twbb1RPOTxj6GsF8voM7kMznJV++Rkn547bWewdOuwaf/uhhyvYXhraqp6QR 0eiIfOr+nICVP05zysyuatCCyEJx2s1ohzoD6PAU= 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 151/236] usb: phy: fsl-usb: add IRQ check Date: Mon, 13 Sep 2021 15:14:16 +0200 Message-Id: <20210913131105.500062354@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 ecc2f30dbb25969908115c81ec23650ed982b004 ] The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to request_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original error code. Stop calling request_irq() with the invalid IRQ #s. Fixes: 0807c500a1a6 ("USB: add Freescale USB OTG Transceiver driver") Acked-by: Felipe Balbi Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/b0a86089-8b8b-122e-fd6d-73e8c2304964@omp.ru Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/phy/phy-fsl-usb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c index f34c9437a182..972704262b02 100644 --- a/drivers/usb/phy/phy-fsl-usb.c +++ b/drivers/usb/phy/phy-fsl-usb.c @@ -873,6 +873,8 @@ int usb_otg_start(struct platform_device *pdev) /* request irq */ p_otg->irq = platform_get_irq(pdev, 0); + if (p_otg->irq < 0) + return p_otg->irq; status = request_irq(p_otg->irq, fsl_otg_isr, IRQF_SHARED, driver_name, p_otg); if (status) { -- 2.30.2