Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp172225pxb; Mon, 13 Sep 2021 16:13:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiJQVo52kzJ6giR5fL/kXgug4j+XjtoFX6nL8bsxpiDkK9gKJOcFNBMO8jly7ETnHu0XTU X-Received: by 2002:a02:1608:: with SMTP id a8mr11874582jaa.36.1631574809388; Mon, 13 Sep 2021 16:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631574809; cv=none; d=google.com; s=arc-20160816; b=nYxgm9QFZNabup7+b/ZDYl29vKVBeW7W1sWBa27HDfBFy5L0tqhYlOtuhpRxmatUcT Vc+bTnnMNfDbD343IdgkRRsXS6J/LE3U9rXZbJYbfm8spr9NoNknrF7gBlGTbzTLNoAB istiz3MnLPLlgntHCk3G6T0iX5HO5BfafbJ4HbognMKfu1kNyffhAo+LAJBiDxUsKi8L Sm4XGQnCrpgjv8NnfZGMTgvXm/42v/oLchuFxvULqBSoy5FvYKoHpVk4074XcOwWLto7 PDVazNOpcB2YtBnpw3hWVwyjsm3MLu/a/NaatBf0J9TKlGD8Uu4m1IgRkEiyj4N9PbfO 8UTw== 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=HvmWXt+xPAy/7QeAz65u2dzj+QI+C768ZTK8LMWappBX1jGANKaDYENpOFe5eXm3nE G7lhD/35d967iov68XBJsh2RVZydRlkdagEI9TAzkePmRvXUDLtSV2tTjqrG0JgAI4OA eOGiwcnkDx3C6dXBjVjwGRYyLNhyz6ZPgcHEKBYIx5HwqYn7ZkhAy91xRcm4qS/IvGdp 1yyOj3bizTjqf12k+PQYlc2Ce55pYsd4LX+S4P3GxtBpt0w4mDTxww9owcI5tThzXVHM zlfsjQUNGQSaJu0bwwUnL8YukZ8vVYhyf5y6dcgZrpL94zRc8vw4AMB94tERMrj35Lyt Jgzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WC88b0XH; 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 e2si62373jaa.68.2021.09.13.16.13.16; Mon, 13 Sep 2021 16:13:29 -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=WC88b0XH; 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 S1346076AbhIMOnN (ORCPT + 99 others); Mon, 13 Sep 2021 10:43:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:56366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344272AbhIMOiL (ORCPT ); Mon, 13 Sep 2021 10:38:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D366C619E1; Mon, 13 Sep 2021 13:54:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631541286; bh=pjnJCroe+DxkfKrNgNYoolpkciWNle+1P5sU88pqt/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WC88b0XH7w2NqlrQ5j64s9WqjshjYIrhO/z4BWc1x8B+KWd+s2Ge2lZdbNo7neLMh nTG26doOjURFNQcR1qi3ZcXq3GLeQTm+u1sSn8ds8CAoJ9MOZbogRdneafS4a9U8re 5IdD3xbCzQFnmMS4UQbN2LH/062ugqIDBudpdlXA= 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.14 205/334] usb: phy: fsl-usb: add IRQ check Date: Mon, 13 Sep 2021 15:14:19 +0200 Message-Id: <20210913131120.342003107@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131113.390368911@linuxfoundation.org> References: <20210913131113.390368911@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