Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1857835pxj; Sat, 5 Jun 2021 05:21:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxjn2+uuaQv96xiB23sI1h5Fnc5GAhTgO1n8haVFD3ocYyCmLBXghca8y98uAhzuHEiYXk X-Received: by 2002:a17:906:5211:: with SMTP id g17mr8988174ejm.281.1622895695738; Sat, 05 Jun 2021 05:21:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622895695; cv=none; d=google.com; s=arc-20160816; b=h5blp8/v+hoAe7iw64uX3K9otebIYAVEXGfqwKZcnt0MfuI5DzqIrpS/3SiMo9CgDO Fg5wOY+1NTDYfVk55Uh8OL0hljG5oDdfNsjC/xOkD6LpYXVf9kfBPYrYYxjEcp49M9E6 2RULiG44hBQR0VFf47hznT/XklbxynalJwmcI0bq+gEKPGX86GLKz2QLg4iwdvSz53tJ /BCMG4JZfJC8LZU6E3SSFL4IiK7DTW8lSeEBrO6C3hCYfGrI9vQxoHMYM6HxQynRj24T 5aQ/Qw3nvMAB0Gz4JtbDoz8Q2ltKgs0JLMREMzCRhcgWSyWKwykSCd1ierZApXjy1Rbd F2xQ== 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=i4So/Bc16jV+/SyVTldTYthT0buqqEsCeqVT2tJ658Y=; b=0mCb/YdC0MqewJ9pFgOmo7duXFdQt7NvQSDHLFwCX60M2LVIYS0cij10n0aUdlv/W+ +MHvVx8niOBjT2SkZoOhCX1aOYQUeMiQ7sUsue2/znYBLNSVpo3L3dCnTajZQXxLml+/ AeNshasJyjW6InHyyKM/DpXxvbrlKl5nlPoOOsBczJh3Dk2fR9wa1DDSVa+fFnZsyGkB cf8+/F1Byq0l4iaFpZj1kzpAs5AnBFkBnvbFeD5brZ2gvwSf1SCep758EUSEjbPgW3x8 vN7at/cRcBtRddzuVgk3OlXjXsPutIoamW7pGnzW2wAOwasJE8ftdEZom0G+LuC9nQAe 0C5A== 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=vivo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si5335896ejk.208.2021.06.05.05.21.12; Sat, 05 Jun 2021 05:21:35 -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=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230128AbhFEMUa (ORCPT + 99 others); Sat, 5 Jun 2021 08:20:30 -0400 Received: from mail-m17639.qiye.163.com ([59.111.176.39]:34106 "EHLO mail-m17639.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbhFEMUa (ORCPT ); Sat, 5 Jun 2021 08:20:30 -0400 Received: from ubuntu.localdomain (unknown [36.152.145.181]) by mail-m17639.qiye.163.com (Hmail) with ESMTPA id 9303838015E; Sat, 5 Jun 2021 20:18:40 +0800 (CST) From: Bernard Zhao To: Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Daniel Vetter , etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Bernard Zhao Subject: [PATCH] drm/etnaviv: remove NULL check which is not needed Date: Sat, 5 Jun 2021 05:18:38 -0700 Message-Id: <20210605121838.8357-1-bernard@vivo.com> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZQkhNTVZJTBkYGUwaHkNMSU9VEwETFhoSFyQUDg9ZV1kWGg8SFR0UWUFZT0tIVUpKS0 hKQ1VLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6NUk6Cio*NT8VAQk2MRgWCCs2 KgNPCypVSlVKTUlJQ0JOTklKS05PVTMWGhIXVRkeCRUaCR87DRINFFUYFBZFWVdZEgtZQVlITVVK TklVSk9OVUpDSllXWQgBWUFKQkJPNwY+ X-HM-Tid: 0a79dc1c6bfdd994kuws9303838015e Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org NULL check before kvfree functions is not needed. Signed-off-by: Bernard Zhao --- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c index b390dd4d60b7..d741b1d735f7 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c @@ -80,8 +80,7 @@ static void etnaviv_gem_prime_release(struct etnaviv_gem_object *etnaviv_obj) /* Don't drop the pages for imported dmabuf, as they are not * ours, just free the array we allocated: */ - if (etnaviv_obj->pages) - kvfree(etnaviv_obj->pages); + kvfree(etnaviv_obj->pages); drm_prime_gem_destroy(&etnaviv_obj->base, etnaviv_obj->sgt); } -- 2.31.0