From patchwork Fri Oct 18 14:08:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 13841860 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 D761CD3000F for ; Fri, 18 Oct 2024 14:11:09 +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=LIm6OQAzr+RryjtTMKyGhiHqPq+vUrCkVmAkH5QUiOk=; b=SXMrfHENVrkyJuRlgDpgGVpIFR cgcMHh4sciLGdx5/csZ1PnI+I6lBFI2jtHp5yM1/AN7JPqUpswn/RNI1XbA1CuNgqXStlEEN6BPD0 q5DnXxVC5+v1kf7STDvPJd6SSxn72mV5E6qxAv0pjtpzt5Fq1drey/t/Kx+Ni3HA0RRTFIYoUkZZo YGx3myiy3wuWuXoeQpiJZ3nY2jIcvS0ZkYymNmrUNIg3lxBrtoYRnj/Ma548Ycprn68Tu6Lc7IzgI ATb1DWFLBmd1CMqcTLhmXcbN846VVSQU5eB/cdTzn4g47aNdzC0/BOspbJrHBf41AsaWBxaGAj1a+ Ug975Xiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1ngv-0000000109n-0px4; Fri, 18 Oct 2024 14:10:57 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1nfR-00000000zxy-27YW for linux-arm-kernel@lists.infradead.org; Fri, 18 Oct 2024 14:09:27 +0000 Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4XVRKh08FLz1HLDp; Fri, 18 Oct 2024 22:04:56 +0800 (CST) Received: from dggpemf100006.china.huawei.com (unknown [7.185.36.228]) by mail.maildlp.com (Postfix) with ESMTPS id AD88F1A0188; Fri, 18 Oct 2024 22:09:11 +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; Fri, 18 Oct 2024 22:09:11 +0800 From: Zhen Lei To: Suzuki K Poulose , Mike Leach , James Clark , Alexander Shishkin , Mathieu Poirier , Anshuman Khandual , , , CC: Zhen Lei Subject: [PATCH 1/1] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu() Date: Fri, 18 Oct 2024 22:08:58 +0800 Message-ID: <20241018140858.711-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-20241018_070925_827387_11310B53 X-CRM114-Status: GOOD ( 11.20 ) 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 Function devm_kzalloc() returns NULL instead of ERR_PTR() when it fails. The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 39744738a67d ("coresight: trbe: Allocate platform data per device") Fixes: 3fbf7f011f24 ("coresight: sink: Add TRBE driver") 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;