Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1825319pxb; Mon, 13 Sep 2021 06:24:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKb2JuyFTdOrLvtpFZHg6DVbvfL6atFFC5kvSUa5hSglMkBG8h8aP5wM0fIO4BjcGVPDcs X-Received: by 2002:a05:6602:2c0f:: with SMTP id w15mr9378952iov.106.1631539466810; Mon, 13 Sep 2021 06:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631539466; cv=none; d=google.com; s=arc-20160816; b=yl+4O30pabKD+Lq+2BYJBVfLKS07zw/mZ/2eFuAIFij5fl7HM9bOu6qfceSthfi+fy Mjea7HdqHdIMS9WruVSzPkzUfvAv0FGRz8amA8c5WfZjcYD0y+5db3FoY39CdI7w5egk M2rLaHFZegUsBR/v+pHJouJ25r0UDUStjEsYqn7YeA0RHtV6rF9MacmMv6tGRZYx/kRs 177C+zjqtX72RXoAcopvlFNmghvpqZbTj6TqeXgjIuwaPTQIUEBTcka//A3Bu/j4TJyC 1/uj9cNmUId0QYwI44GusKSvRmgeCC8/KRv+ay3YXhRFLtzgUgGqwuNts5NIADRDjqyW T8pQ== 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=l364PsPTjtQmlhUQ5r45KjUjjUvUkfeTz6MCGLgJA0A=; b=LkbYa49YQa64to988DKVU+4taLo+eaTrmpzPkwExovULqC/FRyBwRUpU5ViSxf1WVu h4CHN+zeTdlFmGHR4N2WXBHB9v/hp4pTk9YZOvsssHU+xJEC3xXtCJ4DGnwTlZngZsft qkiORgfLS3QOitos+FzG8eZ8YO89JBxew4fByAdFIh4OM9Nfvyz8LP1ww7WA0JvHIGCu Cy8mjSMRAwa5fFv19BAbfaISaW7M9ZeAOiyoLh2DsVQYH2tJ44BcmGuFl5AW/uDjw9zv OrFi8X03U/i3E4nDJ/g2kRTw7pOfGr9myxrWxZDXcju0RWgY3k7pqcm6cKMFxmKfJzBR USgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JBTU3l63; 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 d21si599805iof.73.2021.09.13.06.24.14; Mon, 13 Sep 2021 06:24:26 -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=JBTU3l63; 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 S241372AbhIMNYK (ORCPT + 99 others); Mon, 13 Sep 2021 09:24:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:37988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240863AbhIMNVq (ORCPT ); Mon, 13 Sep 2021 09:21:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1A854610CF; Mon, 13 Sep 2021 13:20:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539230; bh=KoQ/s0vpPzOhjAByrHlhk5MjsC2Gu5Yo2yt9hWzwm7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JBTU3l63QD4RlB8miJwA8GlVSAhDC3GLuLPFGfpPvpHkDkBcn445/OhP8LncV/eod QW0IqzTXMXPkcZzfNYE2H7/ntbrufh4FJQADFGNXZfmES5NMVgG4IvQes9y2UvWPsn LHNVJO3+CGkJRLQQflHEkolNhxZmsV1LHpyWQEnI= 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 089/144] usb: phy: fsl-usb: add IRQ check Date: Mon, 13 Sep 2021 15:14:30 +0200 Message-Id: <20210913131050.929232207@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 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 b451f4695f3f..446c7bf67873 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