Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3630753pxb; Mon, 24 Jan 2022 13:58:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJyK1f6ktQ5MfReCFmP4Pxy5VcgJ46ADXM+f1zVKhL7vxgbajUL4HJ2+U3QCFlL1F1k251su X-Received: by 2002:a17:902:ab4c:b0:14b:4a1c:7813 with SMTP id ij12-20020a170902ab4c00b0014b4a1c7813mr7391496plb.146.1643061490240; Mon, 24 Jan 2022 13:58:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643061490; cv=none; d=google.com; s=arc-20160816; b=q+u60EoZVZlLojF3eICILPAu1bGyRc3bBk6u4aJy+oQGv2AISzpDEuTfZHqW3esi+O rvAQZLPLaHMRdc8rcJCzM5W2yCLQzUs5YnW9mOkPt+X0IH9iDR9/OdK206c4cFcpy6dk wS/mwrQki75mVzGkwahDJMa4dZVYbbhDXKHVEc7796HT9W4upH0Afe6fazskXapaDIGK fOGXmbf2hxOXkfJauC0PN8+hQ78X+VX+COh93wlx55aB6sKtA+BJMq0jBzQuLtAXtT8D T33IQnRhUYWc1ZqfOWT8iHfSl6EiY9A9fJCCTidL85Es+N9Bl40LpKnm37kdPETVN/Vo FFzg== 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=8iKLwYXxXqnE6VarAAFXvtilAxmRra3z2e9/+62+42Y=; b=tTIfHqiR3KAWX7XgNQOSF55LdoaH+YR1XoBY+ZbHO4XUtP6fXz53Dsvkxxt8Hm7qYU uNx7HbV1vU3dRSmr/yslfdvvNfQuL1MWTzFTUWxTC7Bht+f6/yVTTxg5+nfxsUl76ZCv hTLES01efgeEhSe99pr+Uo3N6x3a3A5fgNukcm07zV8rB9yXbanaTyLrAO4QoRvqdZOQ hDjTl6hci9qb+SzblUnv7nFZ1vZyslcrQnLSC0hSoCNC7An4gyS2G9Yj9exeg9El1QIx /HU7R7DsH6oe+9pRjoxMD5XXItzyYWRQr2NLiwMShNjFIf46ZVPwpEkCJ1OgZoZwqb5I 7A4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pwk4rdp3; 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 t26si14320379pga.588.2022.01.24.13.57.58; Mon, 24 Jan 2022 13:58:10 -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=pwk4rdp3; 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 S1574086AbiAXVrP (ORCPT + 99 others); Mon, 24 Jan 2022 16:47:15 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:33722 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1447975AbiAXVLr (ORCPT ); Mon, 24 Jan 2022 16:11:47 -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 ams.source.kernel.org (Postfix) with ESMTPS id A4C37B80FA1; Mon, 24 Jan 2022 21:11:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3C6EC340E5; Mon, 24 Jan 2022 21:11:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058705; bh=LkP5wPAOSpGkOD6OaRU0ev13KEb6uw1g3WHDaHfng7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pwk4rdp3frub+YrOnsN34vV6keJb0khLp0UzlD6sXe+zzrOzOBqLv2mRzvN0FaaQk 7y1/NhmmFUcItZxVz7QIJN4xsOv1kQriDLs7H8vCQ+mDw0oZmuwaKJx3gL2btysB0F wD9X8UAH/nCQU8wYkRVhxPrli+N5kjnG/R++25Og= 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.16 0333/1039] mmc: meson-mx-sdio: add IRQ check Date: Mon, 24 Jan 2022 19:35:22 +0100 Message-Id: <20220124184136.500983288@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 d4a48916bfb67..3a19a05ef55a7 100644 --- a/drivers/mmc/host/meson-mx-sdio.c +++ b/drivers/mmc/host/meson-mx-sdio.c @@ -662,6 +662,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