Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1572811ybz; Sat, 18 Apr 2020 03:58:41 -0700 (PDT) X-Google-Smtp-Source: APiQypIB8UKRGOc7uLcWKYG07igHXjnRq4nYp09+FIL2r+67K9pM4BRVDWXEvtjOJYLAdWB6XrjZ X-Received: by 2002:a50:baa9:: with SMTP id x38mr178929ede.55.1587207521341; Sat, 18 Apr 2020 03:58:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587207521; cv=none; d=google.com; s=arc-20160816; b=qGeVMvOwYGdqEdMHsEIk4no9cD9px8v0vdRPYOBucbIY1jXsKj+JM6akftlmHDV9lN z3SCBx1QlItUJCXcn+s5e2i6/wlBDgBIGjLbcNzUOmcLmTG3lpyZ4rdMG0M1IMvIIy6l QeRr4ZiuFevrXV7FzxkS6y/kws00FFsJhYAGzbahGYcTIPNimLppbLi7Ye5ykzpNHe5w mpEpq65D5Pmp3Boa3F6sMCUvC0WsWqQ0TdxAghEmiGU92kgiIO7rJ57aFi2lnyre8fi5 Lt/HEesyzKn06hbHCkmKZXt8dQf3JyqndUtjmWcrQAmTS89EJyOcwuG1OBNOcaUDKrul w6Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=u2yt9BxF3Q1dv528QXC+QyQN+odSl/zX1gCPspLd4QU=; b=oLAqEWkv1tzMdKbF5Zv07RvhDzzLDmG7QdrcmgO0vylwtgPxDsUpABZz12RaVZj9cf 9wkGKwGwtoVesSbpGWgTMGpyNVG7UlCPIr1gblhfQJChVnIOMX5xP/piWXInPXlOod5G NSwLRt/EdhQ1kPR/EV47/CEY3ThXya6axTLaCXXzx/IhD1b/ea2GdspbMEdqU36qn1rD VR3EtE/+VU4Hhl3yTEbnKbcsZgKe1qrwJA5HFlDU8czUjp3fmfFgUrB4gkqCW14m55zC xZTDQTSTTdOntZUhnE8ALFhj6AO6KCqieoCrsnYM2dt7EBhYoaQgJSSyX4ee5MOw+NLH V0yg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p5si16229954edd.220.2020.04.18.03.58.18; Sat, 18 Apr 2020 03:58:41 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726335AbgDRK4w (ORCPT + 99 others); Sat, 18 Apr 2020 06:56:52 -0400 Received: from m176115.mail.qiye.163.com ([59.111.176.115]:19464 "EHLO m176115.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726318AbgDRK4w (ORCPT ); Sat, 18 Apr 2020 06:56:52 -0400 Received: from ubuntu.localdomain (unknown [157.0.31.122]) by m176115.mail.qiye.163.com (Hmail) with ESMTPA id 107F8663346; Sat, 18 Apr 2020 18:56:47 +0800 (CST) From: Bernard Zhao To: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "David (ChunMing) Zhou" , David Airlie , Daniel Vetter , Felix Kuehling , Philip Yang , =?UTF-8?q?Nicolai=20H=C3=A4hnle?= , Nirmoy Das , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Bernard Zhao Subject: [PATCH] amdgpu_cs_bo_handles_chunk, remove check info NULL branch Date: Sat, 18 Apr 2020 03:56:35 -0700 Message-Id: <1587207396-116489-1-git-send-email-bernard@vivo.com> X-Mailer: git-send-email 2.7.4 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZSFVMTElCQkJMTUhPQ0NMTFlXWShZQU hPN1dZLVlBSVdZCQ4XHghZQVk1NCk2OjckKS43PlkG X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Phg6EQw5Fjg9Cg0POg4iNBIZ AzVPCwpVSlVKTkNMSUtMT0tMSEJLVTMWGhIXVRkeCRUaCR87DRINFFUYFBZFWVdZEgtZQVlKTkxV S1VISlVKSUlZV1kIAVlBSUhJQjcG X-HM-Tid: 0a718cef06c79373kuws107f8663346 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kvfree ensure that the null pointer will do nothing. If addr is NULL, first is_vmalloc_addr will not enter, and kfree function just return when addr is NULL. There will be no risk here. Signed-off-by: Bernard Zhao --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index af91627b..814bd5d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -98,8 +98,7 @@ static int amdgpu_cs_bo_handles_chunk(struct amdgpu_cs_parser *p, return 0; error_free: - if (info) - kvfree(info); + kvfree(info); return r; } -- 2.7.4