Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp66636pxb; Mon, 13 Sep 2021 13:06:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcpyXQJTYasdbXJP0pmjYc6VPx2TEU1EVwXvbrGTHXdHuGXGoQHwlXKDWkuP8lquuSnQZ2 X-Received: by 2002:aa7:d785:: with SMTP id s5mr4895903edq.214.1631563605833; Mon, 13 Sep 2021 13:06:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631563605; cv=none; d=google.com; s=arc-20160816; b=aCYJuIPqYS0YcBl0IJT/c4m5GizcieVRoMPDtXxEaOeUrnJeM28X6pAzVKa0tbcw5H d9QXznUhjLrsIx31faEH9ylNoSaKGNVFR50R7DqCd5SeRqeJ4q2a7/EN3eA0yHC42d8d vCGnCSEQS6yaxM4rdsDSsMCoO195LUojmjlPS2t84UzIbk0P4AvVVKmlLBq6zTN5geUw U2yNJH3kha2y6zZDrvwc2jazrFvL70q5iubjVoYdh7GLdg1nAcpn6lOzGlyOTC0tMNnt j5e/gXJBo06qTLTp+fVUWE6ybhGBy2Ln56kKoD0Vwxbqu/F4hidbba1COsNEBuo759N7 6VVA== 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=oIkgAwfEVDGsjQgD3bSmf9rjrxrnjbqlcw7YWS9l/WM=; b=IepaWSue8/32sbV8CDeIU6v7wyS63ALamusNsvLakPNaV0JDfkcfx3ZkfOCuul3X82 MYuxefHxMxuWxuWPg61Siv7AKf36SS7HdgJstCYz9umJtKm+PDL0CI7d0t/JWeEnsB/D 28fi5pEmOnkHtZAi40bARC2FWpLxSCS8Wne0/uQX/TFnx9TKJzKGbUYoPPmgxh6SG59y bKvAPG8UJSMR9zWkoCExSFpOT9Tw+fFmGPwO3AN0VGlGi5xcS8+Y1awyk9j2TiI1lrOx S0L1NLrpcFEHdeZQpWBFz7RInSX424A8j1KjSp5Cdtydrm1DeSANW2y94WDCCri6TKiG jnQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=N1m+0XPN; 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 bz20si9432520ejc.780.2021.09.13.13.06.09; Mon, 13 Sep 2021 13:06:45 -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=N1m+0XPN; 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 S243955AbhIMNpF (ORCPT + 99 others); Mon, 13 Sep 2021 09:45:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:37790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243828AbhIMNkG (ORCPT ); Mon, 13 Sep 2021 09:40:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6AC9E613E8; Mon, 13 Sep 2021 13:29:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539758; bh=x73VeGWG/wCftAU+sqyya83+jbHEp6i30b7fFTCFvcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N1m+0XPNiVfp2GnYkqXqnxI7zC1I+/ogHl/zHiqVq6L/6ZColBWjSL7cEwqjneil3 ggMMHr+5W1Rb69m4GwZIK7lWaJjm0hGF/wZ4ZagVEcg/jK+thvSeye4YQSLjT8EW34 biqmCWqEfReN3KYLdnvKEk+2yE35U0uvJeqtXAfE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Felipe Balbi , Sergey Shtylyov , Sasha Levin Subject: [PATCH 5.10 150/236] usb: gadget: udc: s3c2410: add IRQ check Date: Mon, 13 Sep 2021 15:14:15 +0200 Message-Id: <20210913131105.468895932@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 ecff88e819e31081d41cd05bb199b9bd10e13e90 ] 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: 188db4435ac6 ("usb: gadget: s3c: use platform resources") Reviewed-by: Krzysztof Kozlowski Acked-by: Felipe Balbi Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/bd69b22c-b484-5a1f-c798-78d4b78405f2@omp.ru Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/gadget/udc/s3c2410_udc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c b/drivers/usb/gadget/udc/s3c2410_udc.c index b154b62abefa..82c4f3fb2dae 100644 --- a/drivers/usb/gadget/udc/s3c2410_udc.c +++ b/drivers/usb/gadget/udc/s3c2410_udc.c @@ -1784,6 +1784,10 @@ static int s3c2410_udc_probe(struct platform_device *pdev) s3c2410_udc_reinit(udc); irq_usbd = platform_get_irq(pdev, 0); + if (irq_usbd < 0) { + retval = irq_usbd; + goto err_udc_clk; + } /* irq setup after old hardware state is cleaned up */ retval = request_irq(irq_usbd, s3c2410_udc_irq, -- 2.30.2