From nobody Sun Jun 28 10:34:17 2026 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 79FD4C4332F for ; Wed, 9 Feb 2022 02:40:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241857AbiBICkP (ORCPT ); Tue, 8 Feb 2022 21:40:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243317AbiBIBjs (ORCPT ); Tue, 8 Feb 2022 20:39:48 -0500 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70D05C06157B for ; Tue, 8 Feb 2022 17:39:46 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0V3yNqjc_1644370781; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0V3yNqjc_1644370781) by smtp.aliyun-inc.com(127.0.0.1); Wed, 09 Feb 2022 09:39:42 +0800 From: Yang Li To: daniel@ffwll.ch Cc: airlied@linux.ie, Felix.Kuehling@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Yang Li , Abaci Robot Subject: [PATCH -next] drm/amdkfd: Fix NULL but dereferenced coccicheck error Date: Wed, 9 Feb 2022 09:39:40 +0800 Message-Id: <20220209013940.71348-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Eliminate the following coccicheck warning: ./drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:2087:27-38: ERROR: bo_buckets is NULL but dereferenced. Reported-by: Abaci Robot Signed-off-by: Yang Li --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd= /amdkfd/kfd_chardev.c index 64e3b4e3a712..636391c61caf 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c @@ -1982,10 +1982,8 @@ static int criu_checkpoint_bos(struct kfd_process *p, void *mem; =20 bo_buckets =3D kvzalloc(num_bos * sizeof(*bo_buckets), GFP_KERNEL); - if (!bo_buckets) { - ret =3D -ENOMEM; - goto exit; - } + if (!bo_buckets) + return -ENOMEM; =20 bo_privs =3D kvzalloc(num_bos * sizeof(*bo_privs), GFP_KERNEL); if (!bo_privs) { --=20 2.20.1.7.g153144c