Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp88367pxb; Mon, 13 Sep 2021 13:44:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMAQE82tIkk3IRm1sloqrqmefO9moJhl7LbCKGJon2g5ONY8YMAOtXe8nkDgY3Ozd2I9j0 X-Received: by 2002:a17:906:a24d:: with SMTP id bi13mr14812204ejb.481.1631565844040; Mon, 13 Sep 2021 13:44:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631565844; cv=none; d=google.com; s=arc-20160816; b=zw9dBzZ3i0dWdWX1FbCFwNbAPv2A/8EsrQThEKAo0QzN2R+NUr16lOi1x4dlD7rCgN xHQBgs3zz8ILX+/nMKrWiR+Lfs249xSYsRQPKPTZhOwfwccrJbaq9JTh81J6wRChHbOe LdRaJL7yG/jXoKWsoK6d3uhIDRc+dP1V8cWpr0EWEO9P4j4frBzT6w2H4Z5JoLWjOIK8 9zjlD45iA2sPT3fh2wAUdPaj7ZyKvwxPuzfA3V9jcDUTQF887/VtP/xVerdTnuR6GZfH MIquYmlzs6SLkY2DxwK/FvBKpLn45zvbX3aJdDOD135xCh2c22/fGmSNj+05U+wBcZep YD2A== 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=R23dTB2LLBhOylKTJDx5NcbXFwZ0/WosSHl8B1Q+x2k=; b=U+l2pHV+6KBN9qI6ePxBBElhIxOMi9Q46mgAMsZcZLbdSEpNdcHL4jpm+e6GlutHVx Epe1l50dqiCMFxSFaVgLm06wpvXLVsVJBnsiAePFysaYnXNb23SpTfS3AYGQ1gKOT01T Itn1wJ7YfOEohlgYxFzun5MTKpv5ZT25ijL50XOgf4c3HPOXrGM/g2eKZiQnzCzIAfIT 1QiqVoq3Rre/cTOTBjyoSBQ4RswWbcsFkbpk9JyIa/rhQA2qPEiyO9AnA+FDQLtIIt8i VsDv1KjgbjEYJUDe/yU42TPE/hc1o8s83I1tpD5Hnz1Tq1Y1ey10UVg3VCwJHQrk6X2d 5xBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="S/+A8qLu"; 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 t27si8338792edi.459.2021.09.13.13.43.37; Mon, 13 Sep 2021 13:44:04 -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="S/+A8qLu"; 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 S243819AbhIMNo5 (ORCPT + 99 others); Mon, 13 Sep 2021 09:44:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:37714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243796AbhIMNkE (ORCPT ); Mon, 13 Sep 2021 09:40:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BF681613E6; Mon, 13 Sep 2021 13:29:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539754; bh=gq9saXxtRIw3MZSwBY8JRo4yxAZ8lKok2m4Ej0sohjs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S/+A8qLuApsXX97Muj6/bP/iczF9R3d2My8k6JytmaSiD6GLE5Cjk0d2K3PUzxAgV 0W49/GY3KNYWnWu6piWt/AJ1G9qG9ZqZJT2lO2gDAYXIfA9hqMEymEexrd1I/YAJGB uJwPXPaY+ICbDGUOoKVWdJvq7RsG1g8q4I1BTKWk= 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.10 148/236] usb: dwc3: qcom: add IRQ check Date: Mon, 13 Sep 2021 15:14:13 +0200 Message-Id: <20210913131105.396337827@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 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 8bd077fb1190..2a29e2f681fe 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -610,6 +610,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