From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D77F9C4332F for ; Wed, 6 Apr 2022 01:13:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1840980AbiDFBOf (ORCPT ); Tue, 5 Apr 2022 21:14:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357908AbiDEK1Z (ORCPT ); Tue, 5 Apr 2022 06:27:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FC3752E44; Tue, 5 Apr 2022 03:11:13 -0700 (PDT) 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 AAACDB81C8A; Tue, 5 Apr 2022 10:11:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3F8FC385A1; Tue, 5 Apr 2022 10:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649153471; bh=J/oTdw4gTIbU4qw4E5l1JZWzyRyCSgOzA8DVNvpbBxI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vlakdZlP5yDryeXz4y+uuRblk2BGdLeKhN3v6G0xSWm99osviRwL+tpc2hZaD63xb Dj5xr/xBkfLYpKYvvmwi0e5i7DDz4ZhG6nUtpwImpOYLFm5EaXxMI3cEgaNSKx0wUx kpcFW9ekXY8c2XcG98YZcZ5v2h9R2wAw7O44amT8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Krzysztof Kozlowski , Sasha Levin Subject: [PATCH 5.10 232/599] memory: emif: Add check for setup_interrupts Date: Tue, 5 Apr 2022 09:28:46 +0200 Message-Id: <20220405070305.745224529@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070258.802373272@linuxfoundation.org> References: <20220405070258.802373272@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: Jiasheng Jiang [ Upstream commit fd7bd80b46373887b390852f490f21b07e209498 ] As the potential failure of the devm_request_threaded_irq(), it should be better to check the return value of the setup_interrupts() and return error if fails. Fixes: 68b4aee35d1f ("memory: emif: add interrupt and temperature handling") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220224025444.3256530-1-jiasheng@iscas.ac.cn Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sasha Levin --- drivers/memory/emif.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c index ddb1879f07d3..55d4c842fcd9 100644 --- a/drivers/memory/emif.c +++ b/drivers/memory/emif.c @@ -1495,7 +1495,7 @@ static int __init_or_module emif_probe(struct platform_device *pdev) { struct emif_data *emif; struct resource *res; - int irq; + int irq, ret; if (pdev->dev.of_node) emif = of_get_memory_device_details(pdev->dev.of_node, &pdev->dev); @@ -1526,7 +1526,9 @@ static int __init_or_module emif_probe(struct platform_device *pdev) emif_onetime_settings(emif); emif_debugfs_init(emif); disable_and_clear_all_interrupts(emif); - setup_interrupts(emif, irq); + ret = setup_interrupts(emif, irq); + if (ret) + goto error; /* One-time actions taken on probing the first device */ if (!emif1) { -- 2.34.1