Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp171223pxb; Mon, 13 Sep 2021 16:11:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycjGTpmKtPjkOxoXxsIfntLwiPmNLhx91883tnrKbkwXDrSo/OpPlkQLEiX9Btm+9N8Oy+ X-Received: by 2002:a05:6e02:1bc5:: with SMTP id x5mr9722563ilv.83.1631574710663; Mon, 13 Sep 2021 16:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631574710; cv=none; d=google.com; s=arc-20160816; b=WrRiWMViDkAkrFt8l4ANQsPStJUAtxxFL6wCKq99E1jwiKqZio5Rn1XrXvq5dDpugt qZlwhV9Hl54fPDkaBV5OBP0tsryp4Oz/RqhQOuZyITPc/dkFJZtH3yqTCn/KycT+ov9X dR2Zm7lUAwfRRZQkx3FIfTEhKYTfSIQ+W/vzGZVq75VhnFsuEA5zq9nJkPzZ6cGp5/nz ApYA0s1NTW5u6bCJtC42VRPZoPCQcCEDf/aekd0PRoMaoHn2yi8X99s0B7LMw9RlgmjR QM2HLGF367YQHZNk8cYd+QWAVMFE7akcJdgVgn0V/3x4qjJJUAbqcyWZcyy/yq7BCdDg VeSA== 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=95ld4QP6YuqKrZxfjYMxVAQWhgfbZ5UT7SvnndAm6c0=; b=eCevkOJ5XegssyZLkAGh73JhHtcqq8cWLneCM/cIuO/X9B8k+WrDax4VGKJ8SRmw8h 0boJ+n6vSMi4wklylRhQUzXxLQO2ZSNI6lr7v+6+WN900kG/OcFQpOQVOuUBFT7sfEFu DBb2gMP0MxjdrCGC3OjT9lGYAUD8QZzWXjAbb/eJ0vJwefcq2hqEONGjqF/WETzNJ3zs Wr4W6zk0kIgYcBR2KmyDG4AdNF+jM2vztqzHMfe/PmsEf16erUVHyfKNUZsM1x57jmsJ huyf1ta9WeRBevJgClQS48TtwGcZ/CYpya+pqFTtH7JiAhq8dBVSOyPx9h9hW1It5ELs 6Qfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RZQd63UZ; 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 q14si2936969iot.14.2021.09.13.16.11.39; Mon, 13 Sep 2021 16:11:50 -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=RZQd63UZ; 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 S1347024AbhIMOkM (ORCPT + 99 others); Mon, 13 Sep 2021 10:40:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:51904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347539AbhIMOem (ORCPT ); Mon, 13 Sep 2021 10:34:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3E4BF61BD2; Mon, 13 Sep 2021 13:53:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631541194; bh=b9YNcmCliiO5LuW1S8Qk0bHedHDC6m3En6NGtRIFRVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RZQd63UZNEjFksGZfICdy7C2ZaOYgZ7yjTVKtC1EWbCjPvdpeAOuKWbOC/rkKghIb 6pn3mkqGrexOkEPZBLMtkZ8detrCvP7zvl74i3dTc+Tj+3mgfrPYrolX63bn446jE+ cCAefoAsHezf5DkODUpQRLmkI9HkCIMhShf4aHAA= 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 200/334] usb: dwc3: qcom: add IRQ check Date: Mon, 13 Sep 2021 15:14:14 +0200 Message-Id: <20210913131120.171679482@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 175006956740f70ca23394c58f8d7804776741bd ] In dwc3_qcom_acpi_register_core(), the driver neglects to check the result of platform_get_irq()'s call and blithely assigns the negative error codes to the allocated child device's IRQ resource and then passing this resource to platform_device_add_resources() and later causing dwc3_otg_get_irq() to fail anyway. Stop calling platform_device_add_resources() with the invalid IRQ #s, so that there's less complexity in the IRQ error checking. Fixes: 2bc02355f8ba ("usb: dwc3: qcom: Add support for booting with ACPI") Acked-by: Felipe Balbi Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/45fec3da-1679-5bfe-5d74-219ca3fb28e7@omp.ru Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/dwc3/dwc3-qcom.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 49e6ca94486d..cfbb96f6627e 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -614,6 +614,10 @@ static int dwc3_qcom_acpi_register_core(struct platform_device *pdev) qcom->acpi_pdata->dwc3_core_base_size; irq = platform_get_irq(pdev_irq, 0); + if (irq < 0) { + ret = irq; + goto out; + } child_res[1].flags = IORESOURCE_IRQ; child_res[1].start = child_res[1].end = irq; -- 2.30.2