Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1868415pxb; Mon, 13 Sep 2021 07:14:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+cmh0/uhaWZ8/iCKFdJxNpVvRpiwb4bzaDkIB8DCSsoHICSue/xTK2qsR7kOT9jLCCse5 X-Received: by 2002:a05:6638:a2d:: with SMTP id 13mr9738629jao.12.1631542464358; Mon, 13 Sep 2021 07:14:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631542464; cv=none; d=google.com; s=arc-20160816; b=wMgu7Ef9tBAOkQJW6+KKuidUYFJP7EkiMDmgU5dJ0Tq2l6v/KzrYwwwMccdWZKdz94 c7KGSqmY6k02i4wxiw0dJ4FTsdff03dEZ1fDBH/AD42X7kbMcS2xeAfs9RJES0DRoO23 oeWDghOULmQ4quIx72RtxjkhVrg42kc/1s0EFvsAHiKoNSCoNZu/ZEjitC9kIAf0Xkbk 1RpZFXgLMvDtrn7RS14BgKp6pIPrV0/N0epZZlDz0gwI1MM9WXL6ELiSaVCTuGdNz7x7 9Lz4GG0WvWCdIrPT+BSoE9U/2Gv8dRbY/pR5QLT9Dik5DBB8w6grtCTUWnO0QqUHT0ek nqWg== 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=Yw+xIh3MqZ5jzSQvWzvfYLMmtQLQgiUFQEBtLR78nP8m7hL/FUrBt+EagGiaIPSeFo 7sQ5aFs/IVHHe4T/M1jN9QiOihpmu/yz2MRmUDcwbs0J1WtI7/JILq75pwBjiuGAvZ9A aZ0wNhbP9h8VM/zmfkWdhHprAv/tbKkRvLB2KxOsgYcS5FucLi3v+hqAzpOOJElLsuXx znINWi8h3UeGR1g50oq4etfr3mLJeB4qT8O25A5HI09JMy0WpFnXlMZKkXrgYRoKxhle KT7aczAFcUGuOuIG9rdAHKtDqGt5KFEYlb8Y9QoezmUkK8ngMPGP5JU9ItAE2CmJc045 nhDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1t05Yz4v; 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 t1si6589258ioj.70.2021.09.13.07.14.10; Mon, 13 Sep 2021 07:14:24 -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=1t05Yz4v; 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 S244564AbhIMOMB (ORCPT + 99 others); Mon, 13 Sep 2021 10:12:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:54744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343697AbhIMOGp (ORCPT ); Mon, 13 Sep 2021 10:06:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EB5A661279; Mon, 13 Sep 2021 13:40:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540407; bh=b9YNcmCliiO5LuW1S8Qk0bHedHDC6m3En6NGtRIFRVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1t05Yz4vQ0igmk8hCa2Cf4KqJ+Kdr/yv1cD9kiuyilivQYV1vp7fmKCAXfrOrswpA ZNZnOCUq1Xx+cacXRJAZt1IqzcN1Y3OFS7WggdwL5ecG6s/w3VBdmSiqbirT6mp9GY YQDFWQGUU/W+/XZZPYgmVyH4J3Iy11BHd6zjkdok= 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.13 180/300] usb: dwc3: qcom: add IRQ check Date: Mon, 13 Sep 2021 15:14:01 +0200 Message-Id: <20210913131115.478252231@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131109.253835823@linuxfoundation.org> References: <20210913131109.253835823@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