From patchwork Sun Aug 8 20:37:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12425105 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E1E2C4338F for ; Sun, 8 Aug 2021 20:39:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8879C60F38 for ; Sun, 8 Aug 2021 20:39:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8879C60F38 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:CC:References:To:From:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=MAmSdqmcEbqPl9zN857h0Tafshgsk2Ngm0fHD174WNw=; b=x07Jeuucqoo3j285f7A940w2fZ 5aOn1ClZdBVYcHv3lV3wRg6Gb+3JrVZdhYaf0Oc4n6AVbCVwkiDpiYA2iVo7sjogwrYntzbWFfWQn BChxVdXk9JqLeudtiOOBQYH2FNm/lzZS/uycK3/ue4h645rHzlgdyJ0DCnFuawS2CDFYM9zi+jV3z OUIky3GVbeWervPje9VnHQ9dIa5wUHFvGDuYDfPjFbnvLrwG/YC6rfQ6W3YEB/ZVlLMaknVDOuy4L ILylu4LxWm2TVUA5FD65Id2RDB/1fSch1gkkFrhiGDatp6YA4mB5MgzAeg+/Ngks2liNEs7ay4hQs L8fwzkpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mCpYQ-00GShL-Kf; Sun, 08 Aug 2021 20:37:54 +0000 Received: from mxout04.lancloud.ru ([45.84.86.114]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mCpYL-00GSeG-KG; Sun, 08 Aug 2021 20:37:51 +0000 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout04.lancloud.ru 3D11220C600C Received: from LanCloud Received: from LanCloud Received: from LanCloud Subject: [PATCH 1/9] usb: dwc3: meson-g12a: add IRQ check From: Sergey Shtylyov To: , Greg Kroah-Hartman , Felipe Balbi References: <717ddd7c-22cd-d82c-e43d-80254718c801@omp.ru> CC: Neil Armstrong , Kevin Hilman , Jerome Brunet , "Martin Blumenstingl" , , Organization: Open Mobile Platform Message-ID: Date: Sun, 8 Aug 2021 23:37:38 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <717ddd7c-22cd-d82c-e43d-80254718c801@omp.ru> Content-Language: en-US X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210808_133749_900183_5EFA2B8F X-CRM114-Status: GOOD ( 11.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to devm_request_threaded_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original error code. Stop calling devm_request_threaded_irq() with the invalid IRQ #s. Fixes: f90db10779ad ("usb: dwc3: meson-g12a: Add support for IRQ based OTG switching") Signed-off-by: Sergey Shtylyov Reviewed-by: Martin Blumenstingl Acked-by: Felipe Balbi --- drivers/usb/dwc3/dwc3-meson-g12a.c | 2 ++ 1 file changed, 2 insertions(+) Index: usb/drivers/usb/dwc3/dwc3-meson-g12a.c =================================================================== --- usb.orig/drivers/usb/dwc3/dwc3-meson-g12a.c +++ usb/drivers/usb/dwc3/dwc3-meson-g12a.c @@ -598,6 +598,8 @@ static int dwc3_meson_g12a_otg_init(stru USB_R5_ID_DIG_IRQ, 0); irq = platform_get_irq(pdev, 0); + if (irq < 0) + return irq; ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, dwc3_meson_g12a_irq_thread, IRQF_ONESHOT, pdev->name, priv); From patchwork Sun Aug 8 20:45:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12425115 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AC25C4320A for ; Sun, 8 Aug 2021 20:46:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2964E60F42 for ; Sun, 8 Aug 2021 20:46:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2964E60F42 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xI4ycF5VwswW5yiXHSktCcLrZZd//kbGBtY2KYfLUBU=; b=Eek/XBB1OARFIc 389DzK6ViVi1QHq85QUiwEmDbmgxwrMny/ADQVlNGhgNC83TTemSVb9ihFGZkNtyPULCRiRZT7b6r KVZMYMtHEbloGgyAclBmC+Gj9vgE+B0YZ5726XaCV3rfmdiXdpcjFKOLSzYRR4bqcJ82Ou2HGh/nb 5ybTO0UfGjt6rcxkUALWk57Ih+Yo4JwcjEAgsegoemN+AUddQqZ7whKY9HTvK5VhfmWnUIwnZ1KMY o1E0Bbyz+CqEN+/v2oOgPXNako8wSR/0oSCKPutfGrqPKhQ35NbAiPY7uWuxB8HJ59JbU1FlGrbm/ GudwAvIYLsjFJ1t9Qo1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mCpfQ-00GTeZ-Gt; Sun, 08 Aug 2021 20:45:08 +0000 Received: from mxout04.lancloud.ru ([45.84.86.114]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mCpfM-00GTe9-S5 for linux-arm-kernel@lists.infradead.org; Sun, 08 Aug 2021 20:45:06 +0000 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout04.lancloud.ru 26F2020C6345 Received: from LanCloud Received: from LanCloud Received: from LanCloud Subject: [PATCH 3/9] usb: gadget: udc: at91: add IRQ check From: Sergey Shtylyov To: , Greg Kroah-Hartman , Felipe Balbi References: <717ddd7c-22cd-d82c-e43d-80254718c801@omp.ru> Organization: Open Mobile Platform Message-ID: <3ebcf6ee-4ca7-d7dc-6e04-62bc4f9e1ead@omp.ru> Date: Sun, 8 Aug 2021 23:45:01 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <717ddd7c-22cd-d82c-e43d-80254718c801@omp.ru> Content-Language: en-US X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210808_134505_140123_E9519D49 X-CRM114-Status: GOOD ( 12.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Ludovic Desroches , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to devm_request_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original error code. Stop calling devm_request_irq() with the invalid IRQ #s. Fixes: 8b2e76687b39 ("USB: AT91 UDC updates, mostly power management") Signed-off-by: Sergey Shtylyov --- drivers/usb/gadget/udc/at91_udc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: usb/drivers/usb/gadget/udc/at91_udc.c =================================================================== --- usb.orig/drivers/usb/gadget/udc/at91_udc.c +++ usb/drivers/usb/gadget/udc/at91_udc.c @@ -1876,7 +1876,9 @@ static int at91udc_probe(struct platform clk_disable(udc->iclk); /* request UDC and maybe VBUS irqs */ - udc->udp_irq = platform_get_irq(pdev, 0); + udc->udp_irq = retval = platform_get_irq(pdev, 0); + if (retval < 0) + goto err_unprepare_iclk; retval = devm_request_irq(dev, udc->udp_irq, at91_udc_irq, 0, driver_name, udc); if (retval) { From patchwork Sun Aug 8 20:57:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12425125 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D268CC4338F for ; Sun, 8 Aug 2021 20:59:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9ABBA604DC for ; Sun, 8 Aug 2021 20:59:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9ABBA604DC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:CC:References:To:From:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=xI4ycF5VwswW5yiXHSktCcLrZZd//kbGBtY2KYfLUBU=; b=n5iMw/5GP89/YH36bdiJ/a38NV iHYxWs8jg9rzDIVSh6ksY13P/f/o54XnVkn9Z3hU5Z5HQTQm+65STyUmgn/Ss3hXWEc3EIC3P6pOb nJP2L79y+Z/azST05qb7nSMOjgkNqVG7TOEvUCNmw5REXJ9EOvbql2PfiYaZCuegAgODithNG+2wo YiBcNMUOLT+s3JRJglyXDP1bOlkYMB5coqXv55XBLhlvslGnfRIRmWvNnlzH84QITktbphKLppBVk 3NS9nnKjgjPrg0dP6MNBMcePeLOXCRUkTA7D0MkidADexjL/mTo6HaPNMaDM3pOaXG8qngreau4+P 1TYkHxEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mCprW-00GVeq-Kx; Sun, 08 Aug 2021 20:57:38 +0000 Received: from mxout03.lancloud.ru ([45.84.86.113]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mCprS-00GVe3-4s for linux-arm-kernel@lists.infradead.org; Sun, 08 Aug 2021 20:57:35 +0000 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout03.lancloud.ru 11F7F20DE925 Received: from LanCloud Received: from LanCloud Received: from LanCloud Subject: [PATCH 4/9] usb: gadget: udc: s3c2410: add IRQ check From: Sergey Shtylyov To: , Greg Kroah-Hartman , Felipe Balbi References: <717ddd7c-22cd-d82c-e43d-80254718c801@omp.ru> CC: Krzysztof Kozlowski , , Organization: Open Mobile Platform Message-ID: Date: Sun, 8 Aug 2021 23:57:29 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <717ddd7c-22cd-d82c-e43d-80254718c801@omp.ru> Content-Language: en-US X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT02.lancloud.ru (fd00:f066::142) To LFEX1907.lancloud.ru (fd00:f066::207) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210808_135734_397821_50949511 X-CRM114-Status: GOOD ( 12.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to devm_request_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original error code. Stop calling devm_request_irq() with the invalid IRQ #s. Fixes: 8b2e76687b39 ("USB: AT91 UDC updates, mostly power management") Signed-off-by: Sergey Shtylyov Acked-by: Felipe Balbi --- drivers/usb/gadget/udc/at91_udc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: usb/drivers/usb/gadget/udc/at91_udc.c =================================================================== --- usb.orig/drivers/usb/gadget/udc/at91_udc.c +++ usb/drivers/usb/gadget/udc/at91_udc.c @@ -1876,7 +1876,9 @@ static int at91udc_probe(struct platform clk_disable(udc->iclk); /* request UDC and maybe VBUS irqs */ - udc->udp_irq = platform_get_irq(pdev, 0); + udc->udp_irq = retval = platform_get_irq(pdev, 0); + if (retval < 0) + goto err_unprepare_iclk; retval = devm_request_irq(dev, udc->udp_irq, at91_udc_irq, 0, driver_name, udc); if (retval) {