Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3653753pxb; Mon, 24 Jan 2022 14:31:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWr/oOjhh3cC7gSVxCVbkGqzM4afgCSbYArWCQi2wSkhFeqRoxhExxQkfkn/K4iKfsu2zv X-Received: by 2002:a05:6a00:2484:b0:4c8:ffbd:4c78 with SMTP id c4-20020a056a00248400b004c8ffbd4c78mr6632481pfv.24.1643063501080; Mon, 24 Jan 2022 14:31:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643063501; cv=none; d=google.com; s=arc-20160816; b=PSb7s2Ilt2KTgFKbGZBg8yBKuMRkPEShSW99GUIIvzqlnrsGcKB+fTAGc34ql9bn67 pbTOJPme1ScXygR3W4/JSeVO4KWPT5ZtKJ+pp1o4YSPtsGrf8C/CIvAq6DZ0gdjkYFso tkcv+6Y+t5btiC8ZzTORkYW0+wq0AZjjDoALoQyc0whvwcI/fSw2atwhIUeYJ2HjxIct yMXUNxS1IDFCQsIsephsca0M8eb043eiJWIg2MqLK1/uDjYoS21/ipoDGaTH6rP48ivm MegVJ47OEUuM4ea0Z/LMWRxOtvZ+NTsXjj2h1GMftC/hmNp33XgtnasHpQk8Qq7AM5OB aVUw== 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=I8O7cxzkDXmLhhzg9Cf9SgXdSCp/UIu9jGLtgbXCr0ywOaxQxtyKsLu1HqsUJKBoY4 iaZlvweA1FZf3MmFZmiLq2UYYNQ1y+R0k9NWD2SEMp/1LzEYPKzWKZTam3xF7s66rIo3 Z8GW8d14DZhs7cmQ+OJgMbwVAHRLTQFreGeZyO5Yjw+qFgl4PUnY8hUDIZ5iNSgK7tlD lov0TgLrNQaaAZH4q2GtfJd15zJrT7iAQ2sjDjmymkNw0e4/reP3j9F/3saktBqs87n4 EjM63xRNSJvMTqxYuYPToGzWiKh39Y/supsIQawUfa6m2fZMuzcCjFtOZ4i8ZO3XXO8M WbZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IA9amDC4; 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 l68si7432694pfl.186.2022.01.24.14.31.29; Mon, 24 Jan 2022 14:31:41 -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=IA9amDC4; 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 S1587810AbiAXW3m (ORCPT + 99 others); Mon, 24 Jan 2022 17:29:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378448AbiAXVha (ORCPT ); Mon, 24 Jan 2022 16:37:30 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27075C05A1A6; Mon, 24 Jan 2022 12:23:38 -0800 (PST) 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 B8BD6614FE; Mon, 24 Jan 2022 20:23:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95EE8C340E7; Mon, 24 Jan 2022 20:23:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055817; bh=LkP5wPAOSpGkOD6OaRU0ev13KEb6uw1g3WHDaHfng7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IA9amDC4aRGmmBjLWhkAPURLcxhRFi33zx4HiDNok29c3m8KnucCE2/0Mn4yc7yWD Qq3XeDCo1Rki6kIYfKOve6+VGQP7a4OqrvCCpjSqfIOAnz5oHlg3eCiAbx5oEH5xd7 I4UaYpNc3SfTVp2jTZ2H6cqDHOy84Pdmuyjy1WEs= 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.15 275/846] mmc: meson-mx-sdio: add IRQ check Date: Mon, 24 Jan 2022 19:36:32 +0100 Message-Id: <20220124184110.427030706@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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