From patchwork Mon Nov 1 14:02:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 12596461 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1922EC433EF for ; Mon, 1 Nov 2021 13:50:34 +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 D308260F36 for ; Mon, 1 Nov 2021 13:50:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D308260F36 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com 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:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=qK8fa/XdJK9QYjmMQ8lh12PJ3cK+pmenuItQv7S6dlk=; b=Jx06gCSIaP2Ec4 yYiRImt3Q45SHbHzc5J2gdHy+r6w66BobdffthSQjbRTN6gHjcK4luRVYeEm3Z6DvWo/xS6cR9PXX l3jEN0+l5bqs3VIyFPbUnUUQLvMZFw3ZazD8rA2hUvSF4KE+yq6/Jp2+KEqObNlZIsFYgI7tEdJDc DkghtCsu9Cgogza8i/XgEuVtoMQw8QD3PaaR561ptmXC291/SS8oVrht1nBKt97S4P/38apop14Gv x5PWaCvXrNaUKDkPVQYUZKkFDZFZ1IFC0HHt4DIgwerJl3TXddQ1U7n0KI8G+i2ja4b5fG1llurMP tqtxt+zMyfVbF9xipTNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhXgT-00GUmy-DZ; Mon, 01 Nov 2021 13:49:09 +0000 Received: from szxga03-in.huawei.com ([45.249.212.189]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhXgO-00GUlr-IS for linux-arm-kernel@lists.infradead.org; Mon, 01 Nov 2021 13:49:06 +0000 Received: from dggeml709-chm.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4HjZ8w3QvHz8v7Q; Mon, 1 Nov 2021 21:47:28 +0800 (CST) Received: from localhost.localdomain (10.175.102.38) by dggeml709-chm.china.huawei.com (10.3.17.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.15; Mon, 1 Nov 2021 21:48:55 +0800 From: Wei Yongjun To: , Peng Fan , Jassi Brar , Shawn Guo , Sascha Hauer CC: , , , Hulk Robot Subject: [PATCH -next] mailbox: imx: Fix return value check in imx_mu_probe() Date: Mon, 1 Nov 2021 14:02:34 +0000 Message-ID: <20211101140234.777272-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.102.38] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggeml709-chm.china.huawei.com (10.3.17.139) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211101_064904_954509_CE8AA3E0 X-CRM114-Status: GOOD ( 11.89 ) 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 In case of error, the function devm_kzalloc() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 97961f78e8bc ("mailbox: imx: support i.MX8ULP S4 MU") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- drivers/mailbox/imx-mailbox.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index ffe36a6bef9e..544de2db6453 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -563,8 +563,8 @@ static int imx_mu_probe(struct platform_device *pdev) size = sizeof(struct imx_sc_rpc_msg_max); priv->msg = devm_kzalloc(dev, size, GFP_KERNEL); - if (IS_ERR(priv->msg)) - return PTR_ERR(priv->msg); + if (!priv->msg) + return -ENOMEM; priv->clk = devm_clk_get(dev, NULL); if (IS_ERR(priv->clk)) {