From patchwork Mon Nov 19 09:44:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 1765631 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 3B40FDF264 for ; Mon, 19 Nov 2012 15:57:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E443E61B0 for ; Mon, 19 Nov 2012 07:57:04 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-da0-f49.google.com (mail-da0-f49.google.com [209.85.210.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D63DE6058 for ; Mon, 19 Nov 2012 01:51:12 -0800 (PST) Received: by mail-da0-f49.google.com with SMTP id v40so1048463dad.36 for ; Mon, 19 Nov 2012 01:51:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=DwAspgElE3p/mzGiJ52JM1vM+yG+NsT4GeO443dbpUc=; b=UvVT96WoEpBs/Eph9FdeatmKK+dMZnrw/tnScer8vNBzZPTF3LqRNFWPj/u23h2Tud Rk+gMkGGk0+6wo8SOnwTURRFBl87MFjV71jI0sovo30Z84IG5iBJhkEk38f6BF3tLhSg hfa/yz/C7iC+LlY4+7/L5aKeUclj+D7vy6aKcMjDt3E2ayCu3r/1oXci70MiMLhoaoLI 7eXM8oNcJxBShj2ZXBG/0DJPm8g6cfNByaCgN5LiXiPSUJUyhUcIfMB2Iqg0mgwumWFv ieDsBLk+JXIdMhCGLN5wbooSVPHl8ideafrROhb/CMT1RLUgttVbPmQnGubOCHv0lDkk lbXw== Received: by 10.68.244.6 with SMTP id xc6mr31812943pbc.94.1353318672034; Mon, 19 Nov 2012 01:51:12 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id l4sm3180099paw.15.2012.11.19.01.51.06 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 01:51:11 -0800 (PST) From: Sachin Kamat To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/4] drm/crtc: Remove redundant NULL check before kfree Date: Mon, 19 Nov 2012 15:14:56 +0530 Message-Id: <1353318299-3662-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQmZEUZQITmg/DrsV3WAYFbdl5YH3SvKqrOctDEoyGe4KH4LS51Th0ckqiXWpNkOshuhSUqb X-Mailman-Approved-At: Mon, 19 Nov 2012 07:53:20 -0800 Cc: sachin.kamat@linaro.org, patches@linaro.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org kfree() on a NULL input is a no-op. Hence remove the check. Signed-off-by: Sachin Kamat --- This series is build tested on the latest linux-next (20121115). --- drivers/gpu/drm/drm_crtc.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 3533609..807336a 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -470,10 +470,8 @@ void drm_crtc_cleanup(struct drm_crtc *crtc) { struct drm_device *dev = crtc->dev; - if (crtc->gamma_store) { - kfree(crtc->gamma_store); - crtc->gamma_store = NULL; - } + kfree(crtc->gamma_store); + crtc->gamma_store = NULL; drm_mode_object_put(dev, &crtc->base); list_del(&crtc->head);