Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2319145pxb; Mon, 20 Sep 2021 18:42:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPNYcpS4jU5Sx9xYJzabyy2SNsLKIFzdyA0hHT+4pZ8CxSP7j20kW/iildG/zZUxMyFDsI X-Received: by 2002:a6b:8f47:: with SMTP id r68mr10735229iod.18.1632188521608; Mon, 20 Sep 2021 18:42:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188521; cv=none; d=google.com; s=arc-20160816; b=fOd+gFyROHyqJ43Ph9bwxCzJhzwuKHGhLY5l0awnPb3NoRnJXBU7eD4XLFs/dfL07r gsh892M8xuvhTT8LnMn3ikMATsW6BL/PV6NgcfU+unl/2nZkvPxMWKLR37v+mUn2BRph vF7ICWnAHxGeYwDDqhB328WCKyKmE+G400Vsf3A0x8FywxffVklHXFjlEglG3brQ0JV4 0jefiWB4NF1mXJPZXYcPMXxmqJAHXVh6Q5ZZOS+MgKJvYjkkaqb0VOr4EARPxa82ADWk curcap0l3scLmSjnVp5tBFyerBvmXcYF2BttfGgHH+Dz3Ac02vVrYmicDTOQkIucK5Zk y2qw== 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=35g83mn08/r2sclGS5BlrI7QwmaKzfwfZgVn7jWgHP8=; b=fJ9OwwFtWEBa4T+M59+IV3GKBPYlPIKuYIQTotePHxslckgKd4ND3liiOwowsJkXrk qmWm6+Wveo8LHVe+BMVNwBOAl0jdby+Y8t+3VX43o7xPloUgR3ZrHLjWukbCvxcoe+eN VSb4xmt6SIjLckpFLf167SAxKQWRUD1qcoC1CCS8fjl65UQ1GqFX2IKhaqTThtak59oW kD7QDEg0iRIDxmg+6QrB5Bmx6DmlrEKhShwF/8pbOVh6pwj6zXxZJnO2n5G64BqFpnUo HXvqm/KPkfZU5sKWbVEniXQdejqpSUkd7ngrNJTpZZk9Edv2asM7oKyORJ512p31s6X0 XA8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K4zhxiBK; 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 v13si4488596ilj.176.2021.09.20.18.41.50; Mon, 20 Sep 2021 18:42:01 -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=K4zhxiBK; 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 S243892AbhITQv1 (ORCPT + 99 others); Mon, 20 Sep 2021 12:51:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:36452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243839AbhITQsa (ORCPT ); Mon, 20 Sep 2021 12:48:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7002561177; Mon, 20 Sep 2021 16:47:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632156423; bh=zatE2GZab1SjxDk+v63GhnraWQW1H2qJWrJ07zY+gY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K4zhxiBKzpnVysJWEBzO+02e07vNAcsxwrCumUtQaZPyknJ/b4YLMWwIF3kP1Ggbb zUuP1MrHtdTLVY+1dqIJ1r3fTPoMvjNqAMrI83auTN1NM6KOgPiPLDGXTzcpH5a5A8 GG2qAeqx0j0TEqI3uzQRMO0GyWE6ePontBdOlgsA= 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 051/133] usb: phy: fsl-usb: add IRQ check Date: Mon, 20 Sep 2021 18:42:09 +0200 Message-Id: <20210920163914.313378516@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 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 85d031ce85c1..63798de8b5ae 100644 --- a/drivers/usb/phy/phy-fsl-usb.c +++ b/drivers/usb/phy/phy-fsl-usb.c @@ -891,6 +891,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