Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1204343pxf; Fri, 9 Apr 2021 02:40:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynJw55Lz6+Vs1+7PzHgsTnUys3MnkbHoO4pmrf9TAr5gvtVQYSgIvJHnDYIw6XqUHlEthp X-Received: by 2002:a62:e315:0:b029:243:e499:d5ba with SMTP id g21-20020a62e3150000b0290243e499d5bamr8202352pfh.75.1617961259251; Fri, 09 Apr 2021 02:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617961259; cv=none; d=google.com; s=arc-20160816; b=lXy445fEEyZWXvTkXsOK4RySmyfGlEC1bW5y9ffRxnAo4WgXo6342qDmcizz00amRW Y2+7BobWYMWMIe/Oq4y2XP78TCZjPmKCrJdUdzKslRbtc2s0IhSKhETp9je6qa9UuhqR vbv569W9TjxRdOH06OhnNINXUcutv/lw8+0AQV+U4mEaMjC7uIPNTew4aBchZwiI26Bj cxmCLMZxLaUaovbzdoTIP9Lktdv9M7yRdiyp9dCjXr0682Gf23Phq9Tl85hqijuu/QCs JwB3hnODITWNNmRiQE42irS5PJQ8bKwNlwx96KNS6orfZgAOvbpYx8xPICbk78Ae4jti 1p0g== 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 :message-id:date:subject:cc:to:from; bh=+6bVO7bP23eikkod8H8iOkEFC3n8OaRkB0YX35ntp1U=; b=pURpb/IqUAhyUV5LwZwvJFF3iO3Xr/8IzSRFZVbb1MTqeyo+0X6AmvfS6K1iOnMkpD BL78B0ARXsq6tRITcsO/YDF3dOccLTFpEHLTDkc6zJZFvp2a8H8ffGjKGHQAWW0iD7Sf VjyjZhKmeEaVri2jkCgpQSwxHSL2fNfyGEma7x55SjpVp4tlq6nG0P5L/7+ZIkPbPMoN N6gI6Ep2I0dRClwL1Jw5JbdAYYxC3d+g0YEUXVjYKUWLDB7emo+vnYlexTkBmSLHVVb5 RNtevL99iKcyrpD0qGXtrs0kVABtIiuYyb9wp5l4X54XRHlh3zm42NMz7u3Og/aURF4k 77iQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c8si2432576pgq.393.2021.04.09.02.40.47; Fri, 09 Apr 2021 02:40:59 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232929AbhDIJjW (ORCPT + 99 others); Fri, 9 Apr 2021 05:39:22 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:15652 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232892AbhDIJjV (ORCPT ); Fri, 9 Apr 2021 05:39:21 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FGtLC5sy6zpWq1; Fri, 9 Apr 2021 17:36:19 +0800 (CST) Received: from localhost.localdomain (10.175.102.38) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Fri, 9 Apr 2021 17:38:57 +0800 From: Wei Yongjun To: , Anshuman Khandual , Mathieu Poirier , Suzuki K Poulose , Alexander Shishkin CC: , , , , Hulk Robot Subject: [PATCH -next v2] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu() Date: Fri, 9 Apr 2021 09:49:01 +0000 Message-ID: <20210409094901.1903622-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Originating-IP: [10.175.102.38] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case of error, the function devm_kasprintf() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- v1 -> v2: remove fixes tag. --- 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 5ce239875c98..176868496879 100644 --- a/drivers/hwtracing/coresight/coresight-trbe.c +++ b/drivers/hwtracing/coresight/coresight-trbe.c @@ -871,7 +871,7 @@ static void arm_trbe_register_coresight_cpu(struct trbe_drvdata *drvdata, int cp dev = &cpudata->drvdata->pdev->dev; desc.name = devm_kasprintf(dev, GFP_KERNEL, "trbe%d", cpu); - if (IS_ERR(desc.name)) + if (!desc.name) goto cpu_clear; desc.type = CORESIGHT_DEV_TYPE_SINK;