Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp172000pxb; Mon, 13 Sep 2021 16:13:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/urLwEwO6fHmakedzt4bMVDsIBNs2vgu3z1y8aBcJiLHUohWH9nOdU5A+HcUCHTbgz9ef X-Received: by 2002:a5d:8a0e:: with SMTP id w14mr10998401iod.94.1631574785366; Mon, 13 Sep 2021 16:13:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631574785; cv=none; d=google.com; s=arc-20160816; b=jlv4kUgtdcufXXGEHGg6bdGKY9CA4GsHqg+kCagkluTS9iFiKp98r4oealumiEdVqe oa2Y4A2mjXCeAsSxww+HzrDqtzglpNnb7DRKmhlrE7Wv3QGNFOsTs1PCmDaStHuN4b68 Qp/jMsbpvEjRtKu71PURLHqyDg/O0FCVELaEBLhgyvagrp4v0Y1RXdcCRENGgtstEf4m d2bBmNrhL4MpfOuugPGlWVCcrMnXXKzJ3/QeQxssgWNK7jXGoloTVtNbQ65vsdedJunt sR2fMarXmpjw+QXuPputdqs2H0TMz6+y1Pvg1FC/YGoBz3M/Wyd8Cguy1GJlDepE1oa0 UmXg== 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=KzA0dQ2kQVnDsbJgxHwsDP7OUdsXdDtGUA4DKkJQ09A=; b=EZ0FL7pf8onQs0gKBnvDYpM4erneuISu6HnvQMAqIxKfbb4PGzM84d7BQ3JrawxbYM XTlzvOfwAEz73WmZrXT/hyZ7eG+Y3oK4MAT1g7Ao4e6d0B/UoT/6tTxNJ0q1DQp+bdSi NRNv52efPig8BUQsNcmveVLsabUbatbpKzyfBsiBNACPrB7o9noid9MKgBIFjAcyzVDx X0j4eBvAxUT4NJfZ10FzigWA4nkelGi+Iwi1uiYeP8FHbizk7SOvB4mDmOUQAqVcKIKw 6vb6fILaQzetmTyr4OhnFFMuNR/ZUSn7zi2gyiMUNb7bcp2RCUncD24SQdP5LkdCQ8DD JuiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vkClGtLq; 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 k17si8786732iow.29.2021.09.13.16.12.54; Mon, 13 Sep 2021 16:13:05 -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=vkClGtLq; 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 S1345520AbhIMOkz (ORCPT + 99 others); Mon, 13 Sep 2021 10:40:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:53786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347790AbhIMOfc (ORCPT ); Mon, 13 Sep 2021 10:35:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EF6FB6187A; Mon, 13 Sep 2021 13:53:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631541214; bh=HBTmjRiToZImigBncE/nlCtd+VG7mpo2iB6sHH8Q5A0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vkClGtLqkO9S79BbGWAJgbGkDJ3gzlLg3hnMFMk7c9kJ5ov0TG0bJ9mBznV9J/tMu JWILKOT76RzV5GbfIc+mM4KbxEmhqCdvJrZl9TRZdNne+FvdBA8icq6jnGjOLO8xHs 3jK1k3VeHoCx+ZSOHES2zyfAyS7M6HLJggew2Sbo= 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.14 202/334] usb: gadget: udc: s3c2410: add IRQ check Date: Mon, 13 Sep 2021 15:14:16 +0200 Message-Id: <20210913131120.236416533@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 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 179777cb699f..e3931da24277 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