From patchwork Mon Oct 21 07:21:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen (ThunderTown)" X-Patchwork-Id: 13843694 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 23652D3E18D for ; Mon, 21 Oct 2024 07:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding: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=eCJ+hnWc8wURXon9urdrnxLvjFNmzKZR8wsONH77aoE=; b=cyx/peY4BJHtZEFgYzBYBcGtBi oe6oLMTKuSFq4vhffa/s/q7Xk/5A+ae0Ug+RlsWMc5fIczRIDsYt7cTjDzC9kXe5mu4CXiaYmrIzX GpptGY85PzbwyFKw4azU9fSRcFps7MxkyfakMrFv9wjAPzRYxFDGfMurCFRCAiC+cGqtLlOUuFidS a9OaOB1lPEzmnDLHj0i9Jrbmdw3yjWrc0LuS9jXmykH+0rSXJjtr0y9vbgJ6sfaKWZMePk68G64A2 zqeHJl6hPhVCaRvJxxkeUrmcYhU3zlwgAqZbYUNPAAiCmxSc4e3ky6WiJZ7kZ2JQUFxoT4QSzenTF +iQ0/JJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t2mnj-00000006Msi-2YrR; Mon, 21 Oct 2024 07:26:03 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t2mjf-00000006Lx3-0ktt for linux-arm-kernel@lists.infradead.org; Mon, 21 Oct 2024 07:21:54 +0000 Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4XX6Bm2nyCzpX5r; Mon, 21 Oct 2024 15:19:44 +0800 (CST) Received: from dggpemf100006.china.huawei.com (unknown [7.185.36.228]) by mail.maildlp.com (Postfix) with ESMTPS id C866A18005F; Mon, 21 Oct 2024 15:21:41 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.178.55) by dggpemf100006.china.huawei.com (7.185.36.228) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 21 Oct 2024 15:21:41 +0800 From: Zhen Lei To: Suzuki K Poulose , Mike Leach , James Clark , Alexander Shishkin , Mathieu Poirier , Anshuman Khandual , , , CC: Zhen Lei , Markus Elfring Subject: [PATCH v2 1/1] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu() Date: Mon, 21 Oct 2024 15:21:19 +0800 Message-ID: <20241021072120.739-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.37.3.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemf100006.china.huawei.com (7.185.36.228) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_002151_536551_CC202A1B X-CRM114-Status: GOOD ( 12.17 ) 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 The commit in the 'Fixes:' uses devm_kzalloc() to allocate platform data memory instead of coresight_get_platform_data(), but forgot to update the return value check code accordingly. Fix the incorrect return value check for devm_kzalloc(), which returns NULL instead of ERR_PTR() when it fails. Fixes: 4277f035d227 ("coresight: trbe: Add a representative coresight_platform_data for TRBE") Signed-off-by: Zhen Lei Reviewed-by: James Clark Reviewed-by: Anshuman Khandual --- drivers/hwtracing/coresight/coresight-trbe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c index 96a32b213669940..93fe9860acf16bd 100644 --- a/drivers/hwtracing/coresight/coresight-trbe.c +++ b/drivers/hwtracing/coresight/coresight-trbe.c @@ -1266,7 +1266,7 @@ static void arm_trbe_register_coresight_cpu(struct trbe_drvdata *drvdata, int cp * into the device for that purpose. */ desc.pdata = devm_kzalloc(dev, sizeof(*desc.pdata), GFP_KERNEL); - if (IS_ERR(desc.pdata)) + if (!desc.pdata) goto cpu_clear; desc.type = CORESIGHT_DEV_TYPE_SINK;