From: Daniel Vetter Subject: [PATCH 03/13] drm/cirrus: Remove unnecessary NULL check in bo_unref Date: Sat, 5 Apr 2014 11:44:52 +0200 Message-ID: <1396691102-22904-5-git-send-email-daniel.vetter@ffwll.ch> References: <1396691102-22904-1-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by gabe.freedesktop.org (Postfix) with ESMTP id D17EA6E1D8 for ; Sat, 5 Apr 2014 02:45:14 -0700 (PDT) Received: by mail-wg0-f46.google.com with SMTP id b13so4560465wgh.5 for ; Sat, 05 Apr 2014 02:45:13 -0700 (PDT) In-Reply-To: <1396691102-22904-1-git-send-email-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: DRI Development Cc: Dave Jones , Daniel Vetter List-Id: dri-devel@lists.freedesktop.org ttm_bo_unref unconditionally calls kref_put on it's argument, so the thing can't be NULL without already causing Oopses. Spotted by coverity. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/cirrus/cirrus_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_main.c b/drivers/gpu/drm/cirrus/cirrus_main.c index 4b0170cf53fd..b119f66fed92 100644 --- a/drivers/gpu/drm/cirrus/cirrus_main.c +++ b/drivers/gpu/drm/cirrus/cirrus_main.c @@ -264,9 +264,7 @@ static void cirrus_bo_unref(struct cirrus_bo **bo) tbo = &((*bo)->bo); ttm_bo_unref(&tbo); - if (tbo == NULL) - *bo = NULL; - + *bo = NULL; } void cirrus_gem_free_object(struct drm_gem_object *obj) -- 1.8.5.2