From patchwork Mon Nov 19 09:44:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 12918 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 B83F523E08 for ; Mon, 19 Nov 2012 09:51:30 +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 695E2A18443 for ; Mon, 19 Nov 2012 09:51:30 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so6161934iej.11 for ; Mon, 19 Nov 2012 01:51:30 -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:in-reply-to:references :x-gm-message-state; bh=rddu4gVnvJoEGKifAoR/CafQzxF/Sgfq/4gbaYKeeRs=; b=D9GcbK2ZGuzKqpFgyZcMxPpzIQv8rN8r3dpEg32P4KcDaF1uVunQnmbdL/XxOc+cic lcqLM0jbKMA7PUe4FfiWkxb7HTAlYtwJ9l3OHFGPZIkYBSEz4k5Wi0vwUwtGNBStJdUy 8UiiC9QWfZT1aDvzDvQxBh704g8bumO/SSmVEo5N3L/wFgq8ick1HcsyXvmgG265H7xn 0wGzrmQ+eji/7CouicVzipWNgkr6eYi2LcGJRxXnVfKFbiFh/QM0qi+7qK9aaJjbYquF 2O+dQJxhRz8kK8HDoazgALElf6F9JIbQtlJu/D1UKeqQBwMV+hVXz/bNxftsnJb36Ges j7Bg== Received: by 10.50.187.197 with SMTP id fu5mr5952014igc.70.1353318690181; Mon, 19 Nov 2012 01:51:30 -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 n20csp135930igt; Mon, 19 Nov 2012 01:51:29 -0800 (PST) Received: by 10.68.231.41 with SMTP id td9mr31417863pbc.128.1353318689485; Mon, 19 Nov 2012 01:51:29 -0800 (PST) Received: from mail-da0-f52.google.com (mail-da0-f52.google.com [209.85.210.52]) by mx.google.com with ESMTPS id s9si12732766pav.291.2012.11.19.01.51.29 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 01:51:29 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.52 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.52; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.52 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-da0-f52.google.com with SMTP id f10so2032762dak.11 for ; Mon, 19 Nov 2012 01:51:29 -0800 (PST) Received: by 10.68.212.106 with SMTP id nj10mr37526600pbc.101.1353318689222; Mon, 19 Nov 2012 01:51:29 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id l4sm3180099paw.15.2012.11.19.01.51.23 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 01:51:28 -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 4/4] drm/drm_stub: Remove unnecessary null check before kfree. Date: Mon, 19 Nov 2012 15:14:59 +0530 Message-Id: <1353318299-3662-4-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353318299-3662-1-git-send-email-sachin.kamat@linaro.org> References: <1353318299-3662-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQk9AGnmRk8s7WV+i2WtbrBD/WM68f/cv5t8Cgd8P00Z3TEw3MxtQltYeLDef0kE/0PVjQ4i kfree on a null argument is a no-op. Silences the following smatch warning: drivers/gpu/drm/drm_stub.c:496 drm_put_dev() info: redundant null check on dev->devname calling kfree() Signed-off-by: Sachin Kamat --- drivers/gpu/drm/drm_stub.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index c236fd2..2d4beff 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c @@ -492,10 +492,7 @@ void drm_put_dev(struct drm_device *dev) drm_put_minor(&dev->primary); list_del(&dev->driver_item); - if (dev->devname) { - kfree(dev->devname); - dev->devname = NULL; - } + kfree(dev->devname); kfree(dev); } EXPORT_SYMBOL(drm_put_dev);