Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1843059pxb; Mon, 13 Sep 2021 06:45:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxthMPuftkpMEcae6Y2oIr6e7mcJJOz6o129L6XwYsl115KGiWOAj1jy8MKXTJ4vWm6gWAk X-Received: by 2002:a02:1dc9:: with SMTP id 192mr9962719jaj.92.1631540757352; Mon, 13 Sep 2021 06:45:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631540757; cv=none; d=google.com; s=arc-20160816; b=dF94YtL/d8KwfhTr3vO6O8t6SVe6Hccr1pZtFdbUJKju7YvGrchjmTqjCg0MrC7KKZ OOUZ2NP5n4d2ZYXX8IMu0io2ddTy6eVkCpOPfkiGpvt7nsTwzVDf+TQ1Uhl7GE1qeDYB c5n/WlyeMfmBf674VM/tiqx07Uo1kRGoorn62xzSOCEy6hH3Ip929xqwMx9RSfEz7n+X VJ6jPJkZAEt0GuOozTj7oU2PMOVEXY+gMTIskzk+DhCKRdvIrWQ/ohzWhpO/+isHaR3t VFu9IFbumIfTc5kiX9UIG7Z3Snwuaq5F+LAalwnteU+ab4vJ1PFvyxp29YXQgfHhnPF0 W5dQ== 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=pcS3ZC3VzHP4nh1u3vplNF3flfVrNtC+pcm9mrah+to=; b=DOa2o4kewxOsPw0mzG+rcJXmfhfs29+oGxSNTV50aCnvvFdY9cYEPRZtOJh9gDDcNk HVpZb9OjYo5zrW6xVgaH/p9LeXIFD+UDbmhvTgGG8JEByj2UvwwqzAqzZRuLLpdmVVTC opVf+QX9avCKp0N44M2qyS3VadB2IINP+XTT0IhDlc33JeWKTVkObKWliRH8tp134IRw pDvAbOs96g/8O2xTlYqcoEnOHgRg3oi6gmFhCnP1J63NVIpLGNFXAokNlyt3kTNm6/Ih Ys3YwPALISubpiQwYLHb3D9Zw4i/o4EbGFr30/FH3FuDBywarxIgVVgvb189quVSKaxY ekJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hs9KzeXE; 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 v2si6674154iot.49.2021.09.13.06.45.37; Mon, 13 Sep 2021 06:45:57 -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=hs9KzeXE; 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 S243913AbhIMNpC (ORCPT + 99 others); Mon, 13 Sep 2021 09:45:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:37704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243789AbhIMNkD (ORCPT ); Mon, 13 Sep 2021 09:40:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6AACF613D2; Mon, 13 Sep 2021 13:29:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539751; bh=xWzOSUC3nB4FNyqD6n8KAzMIGWPa7Q6zrHX4Mng4a14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hs9KzeXEcf6IhdXVy1rWcQsArHqMMZVmcUTkbRhdp36nnHBc9s+qNyRke7coZFga/ cLQ7pOar6h0eGj6ZmR9I8eNk0lBzWvNgyWStcp1LKDE/8E4qvYiTPpdR677dl+VX7R WIimgGneT/Mxk6J3azh6UValTgeoy/5DA4HPSj/Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Blumenstingl , Felipe Balbi , Sergey Shtylyov , Sasha Levin Subject: [PATCH 5.10 147/236] usb: dwc3: meson-g12a: add IRQ check Date: Mon, 13 Sep 2021 15:14:12 +0200 Message-Id: <20210913131105.365257735@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 baa2986bda3f7b2386607587a4185e3dff8f98df ] The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to devm_request_threaded_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original error code. Stop calling devm_request_threaded_irq() with the invalid IRQ #s. Fixes: f90db10779ad ("usb: dwc3: meson-g12a: Add support for IRQ based OTG switching") Reviewed-by: Martin Blumenstingl Acked-by: Felipe Balbi Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/96106462-5538-0b2f-f2ab-ee56e4853912@omp.ru Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/dwc3/dwc3-meson-g12a.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c index ffe301d6ea35..d0f9b7c296b0 100644 --- a/drivers/usb/dwc3/dwc3-meson-g12a.c +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c @@ -598,6 +598,8 @@ static int dwc3_meson_g12a_otg_init(struct platform_device *pdev, USB_R5_ID_DIG_IRQ, 0); irq = platform_get_irq(pdev, 0); + if (irq < 0) + return irq; ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, dwc3_meson_g12a_irq_thread, IRQF_ONESHOT, pdev->name, priv); -- 2.30.2