Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp217928pxb; Mon, 13 Sep 2021 17:26:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTJTKoiHwRiCAAqoECBSr4G7PE+cuyl4/aOMv0QGbLThGBOuJWu9pX4iYbSS6HRKnwvnyd X-Received: by 2002:a17:906:15cf:: with SMTP id l15mr15581005ejd.568.1631579172679; Mon, 13 Sep 2021 17:26:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631579172; cv=none; d=google.com; s=arc-20160816; b=bVNdmvSZ/ZgiWsLSEJlunZCOOh7p3ULvPRjJMbiPEP1S23tz88Iv2e1420yMyg8Ai+ 38G9ADY8bb6keDRrE0XOCyto/lHt13PPI8d7T1BQHkvZj/zVy3MdozUR0nflsQt+G45m OM5/KL6Om9axgklU3ph3Rfp9nbBIg/xMwomLessjoayg/HtlBC8UJq1Bg0Fhzn9GfT9d LH3E2myjFmJXZVYvVXjqzuiehDUj/1zVN5iPxUFChcdgGcinEa22OEbsFUPReIPY5wOb hw1m1tK4/7EHEo7jv4ldlxqso6ZLKBo3cm7MyQmdM5eB6pes2CvETL7cjqydtV+RLnmv G8hQ== 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=xNnjWlaa0ZaYM5KV7KHnjblgFRow3o1Z33uicKwNtZ+xFP53Co3NuxIlfG3sYAucjQ /rN3eQvlGbNWiGCE6IU2t2vO0Tfb6vmrcGaQivo6YRxSSp9Jf/s4Ob/zdfndfDu3h/0Z VAOyCgua/eOBmwOxs9Fi74cXo2smIqbyztR2r3KzpEafmSrg6jaAbSHVj7S3FVmrt8qF NPYrS9vsRzSJ5vqI4Vy7sHRGvZ+Ki3UPsY3EtPuE+xEpO8ZhdPtx/ciG9MgugAXfrpie D/1xDp6rb4FFIxWu+XW1C40vv5IHgqd1oPLrGs1T/xdVJn8I2ai2tZnbERuvW2YmKn7B qLBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=a0OtNno9; 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 l12si8360981edb.8.2021.09.13.17.25.49; Mon, 13 Sep 2021 17:26:12 -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=a0OtNno9; 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 S1345010AbhIMOJi (ORCPT + 99 others); Mon, 13 Sep 2021 10:09:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:54798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242662AbhIMOGr (ORCPT ); Mon, 13 Sep 2021 10:06:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6E49661A6C; Mon, 13 Sep 2021 13:40:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540411; bh=x73VeGWG/wCftAU+sqyya83+jbHEp6i30b7fFTCFvcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a0OtNno9Gl/X+igHIbLJgR5L31Q2hIZWVwyyHOscW1elU29XNWBY2kuzmJSoRzTmT DKVsRthIWca5bhAvJ6xoCQbnpM68sqnKumiWiGt41NmGqHIi41U4f+xdmk3DZlOUZ6 hlBMtwLAdSDwtA5m+sL1OIqMO8ii2eQSR8TGASJw= 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.13 182/300] usb: gadget: udc: s3c2410: add IRQ check Date: Mon, 13 Sep 2021 15:14:03 +0200 Message-Id: <20210913131115.541383083@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 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