Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3574593pxb; Mon, 24 Jan 2022 12:34:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwSktWU6CiYezZQz+4ysn/TIw1ZiUQBMM2QOYgp+t9hNJmTge/z90jfku+6vSESg776Zt1b X-Received: by 2002:a17:902:f54b:b0:14b:5099:9063 with SMTP id h11-20020a170902f54b00b0014b50999063mr5918212plf.86.1643056472162; Mon, 24 Jan 2022 12:34:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056472; cv=none; d=google.com; s=arc-20160816; b=IpFu13yjEx8BmxGq06rhckbzofONA8ZKNXnMGU9Cgu6PTD4iW2CB5JTwiDDRr/pJ2n PSJejH+Hb+mv7ODautiBQl8giYbZGvwq9/bhCmQZTeoEcj2BQ47EwPv2lP6yioFQu/G0 SfAlTKm1dy06YUucWMnJAOC49a7oFG2gRbIBOsSBLG0NRoV/nfo0iE/0b1YswaMBRkEP 2Qf1UmZacTb6dN4A6WXjkvAseRCbtlcOl8MqV9rrX7khAGBON61bNlC7P8ZTGwNmzUI4 F0rsw3beyVUnbMChGXrJHttJ1u6SE3V6WBO/yIsdkg0gIY+xMhA3V7ztkTxru85EMQDN +jCw== 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=daHNp9sbpVTjzJulhJYkfapauHrsLuyn6sjQv6Iu3kU=; b=tHOQrpPhw7RDAeTND+0gZie0pEFiRJ2V5+dD5DMoxzF2/Ky80QQ404P/NwN56DEtFg xw7GQxNshVkRRcbZWPsHajh5g/innemggE7fT2AZlI/pFwLtk3cZmG8Ha3HEYeOi50iX zClGBr7RHOadZvHhoTIWJF04PTqKekY/S9DNaf9p1AFw34rfgaMl/tpOL30v0BWx/p73 NhxUi/l5sHsgPRoec6iCSRd1nD7LlMcnDOeC3TSbFGcz0c2AXky7gpVccQlMWUFfOpSd P5X4qMbsarHTBjOQPsyl9X9XHAR72bVNB5yVF30ErBp0SkJ8g829Twpwc3plysziSEsY zP3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RtaD40Nq; 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 b4si13609616plg.125.2022.01.24.12.34.09; Mon, 24 Jan 2022 12:34:32 -0800 (PST) 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=RtaD40Nq; 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 S1347677AbiAXTnx (ORCPT + 99 others); Mon, 24 Jan 2022 14:43:53 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:58052 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352897AbiAXTbO (ORCPT ); Mon, 24 Jan 2022 14:31:14 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 09DC561482; Mon, 24 Jan 2022 19:31:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E29BEC340E5; Mon, 24 Jan 2022 19:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052673; bh=Yfx4afU5U/SUeFI8vDC9AXyMNEsK7W7v+iXmHZLdwWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RtaD40NqMM8WNjQRWTmcJwab5y3NB7/EFJP9vj4GWdxt8RbKKZKUU6fjHzl7K9/Mv z7DvYPZLL86ipa6ju552f0YJfePmGzTtJrbMRpcu7dfORgkAqVA5WnpycXoFel8zIt JU4hx8tHNNJ987E6NR4npcFelJ50B3UDg0Etj2k0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergey Shtylyov , Martin Blumenstingl , Ulf Hansson , Sasha Levin Subject: [PATCH 5.4 094/320] mmc: meson-mx-sdio: add IRQ check Date: Mon, 24 Jan 2022 19:41:18 +0100 Message-Id: <20220124183956.933670845@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@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 8fc9a77bc64e1f23d07953439817d8402ac9706f ] 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: ed80a13bb4c4 ("mmc: meson-mx-sdio: Add a driver for the Amlogic Meson8 and Meson8b SoC") Signed-off-by: Sergey Shtylyov Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20211217202717.10041-3-s.shtylyov@omp.ru Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/meson-mx-sdio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mmc/host/meson-mx-sdio.c b/drivers/mmc/host/meson-mx-sdio.c index 360d523132bd5..780552a86ec08 100644 --- a/drivers/mmc/host/meson-mx-sdio.c +++ b/drivers/mmc/host/meson-mx-sdio.c @@ -665,6 +665,11 @@ static int meson_mx_mmc_probe(struct platform_device *pdev) } irq = platform_get_irq(pdev, 0); + if (irq < 0) { + ret = irq; + goto error_free_mmc; + } + ret = devm_request_threaded_irq(host->controller_dev, irq, meson_mx_mmc_irq, meson_mx_mmc_irq_thread, IRQF_ONESHOT, -- 2.34.1