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: 12915 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 215FC23E08 for ; Mon, 19 Nov 2012 09:51:14 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id C1A72A18EA9 for ; Mon, 19 Nov 2012 09:51:13 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so6161934iej.11 for ; Mon, 19 Nov 2012 01:51:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=DwAspgElE3p/mzGiJ52JM1vM+yG+NsT4GeO443dbpUc=; b=PvNSmeTX4mkwhBeQqhP48KFqmOu0A/OLy1W41l95zaSLFCYNk2CgyYIFHa5YyXDGW8 Z3Tld7rJP6Zu+LNlUfKE5dpdZWkQfc5nO1mmUjdGDsZxMuuVqEqnCnue2an1p+hRHf4d KEWFY3zxH6yhXTnzpYNzbK+L/A8jRmwdYamcHJuhTPcJp5NQf68C9qpzl8shvG7X3AKZ tkP1bVMwz+k0/UdkjWKuDlb2BMV6GP0JsFKxMGj48Y9udBuQ6m5I6D6Aga6MLv8QCqOi W+jYscF09S9X4Wy95XCYfbDM5dk0pqfWDunLrzwr3Yzjvn2RZnfOzGe4WaDVWRRW3SUo SVmw== Received: by 10.50.161.169 with SMTP id xt9mr5934220igb.62.1353318673204; Mon, 19 Nov 2012 01:51:13 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp135900igt; Mon, 19 Nov 2012 01:51:12 -0800 (PST) Received: by 10.68.233.196 with SMTP id ty4mr31813381pbc.23.1353318672471; Mon, 19 Nov 2012 01:51:12 -0800 (PST) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx.google.com with ESMTPS id zw5si13152505pbc.67.2012.11.19.01.51.12 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 01:51:12 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.47 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.47; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.47 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pa0-f47.google.com with SMTP id fa11so3059461pad.20 for ; Mon, 19 Nov 2012 01:51:12 -0800 (PST) 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 Cc: airlied@linux.ie, airlied@gmail.com, sachin.kamat@linaro.org, patches@linaro.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: ALoCoQl1PeLAiAiSf43ssmpPR2z0dzFx0/b06hpXmiB/o8nIhRWWxFny/s0Ob03wT/ylZPWdkyHj 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);