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: 1765661 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 7A39A3FCDE for ; Mon, 19 Nov 2012 15:59:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 80F26E61AA for ; Mon, 19 Nov 2012 07:59:28 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 45209E607A for ; Mon, 19 Nov 2012 01:51:29 -0800 (PST) Received: by mail-pb0-f49.google.com with SMTP id un15so3123540pbc.36 for ; Mon, 19 Nov 2012 01:51:29 -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:in-reply-to:references :x-gm-message-state; bh=rddu4gVnvJoEGKifAoR/CafQzxF/Sgfq/4gbaYKeeRs=; b=ku64hAkVxPC4pfKy60FF7R59JoTQ6xTTfTmeE175q5EypdyLpgOUwwWnS9YRCxLvcV o7jT1zpdSve9jBT+lbGH+i+7PeftRDLioc1La6NU9SbD7ntOmvMTX1dhj9INvgxkSFKY oMldtSkEWCXHBI6yyiCcGWDylsojOG6X2DkOMEzqtcTwyuEcaFPtokEqr8X2UvelDTHV Vd+jMKa2VHB4lfjKdw0flx22vpWkEtDyYx9XpxKEc4XnrgI+AOQMw7LmvByippGSEZO4 rqPJE453rwipHXualRkrH6zwWWQ2dE+vhn+At/F/usNFvvY/f7leJd6WRsl7O2IEwj7+ 0K5g== 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 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: ALoCoQnTE5Qb3H+a/PTYgdHR345AJHEnXshPNskc25DCVyk4Et1dj+KmYvtfG9By7Bm2/U7aV7A6 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 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);