From patchwork Wed Nov 21 05:19:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13022 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 95DC623E08 for ; Wed, 21 Nov 2012 05:25:21 +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 4180CA192CB for ; Wed, 21 Nov 2012 05:25:21 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so9374530iej.11 for ; Tue, 20 Nov 2012 21:25:21 -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=EqGiGVB61gkDzEIzKCnhAasolqYZ4Sqxw3sZu8r0r5s=; b=XfDqQlazM7EvMTIiZQ1TqLsy39pZfljTGTPC/j7sEOesuBHZboFWVbeNW1A7eWuRE+ 4GpI1Mwd2vcOjbx0CD+zm3lb88RbRwqmkVTWslGSeKbFRpUFqQ8+JS+QiRPOVXB8ZM24 Mzdf4USyrH4v2AgYUZwqOUiAExvBKsm6jvyzouWXsQxzU0tlauIgcdq8l/2Haud8X0wj 0MvZ9gDt1B3MM2vwhNERWL7FSEugVl3aNtuza/bzM+VY0eR7yK3ZfVkydVUS9/SLFK6O ciQUCDuLq6m7xZ3C+tQMZ09M8CJ1PSnazSv3MMIVvKoMAoxQqQ2Qs8JWc8G+lKTwP2+3 DUjg== Received: by 10.43.125.133 with SMTP id gs5mr16330359icc.54.1353475521030; Tue, 20 Nov 2012 21:25:21 -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 n20csp435103igt; Tue, 20 Nov 2012 21:25:20 -0800 (PST) Received: by 10.66.73.135 with SMTP id l7mr14802115pav.55.1353475520085; Tue, 20 Nov 2012 21:25:20 -0800 (PST) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx.google.com with ESMTPS id v5si20899521paz.57.2012.11.20.21.25.19 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 21:25:20 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.45 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-f45.google.com with SMTP id bg2so2339051pad.32 for ; Tue, 20 Nov 2012 21:25:19 -0800 (PST) Received: by 10.68.239.198 with SMTP id vu6mr56666308pbc.109.1353475519660; Tue, 20 Nov 2012 21:25:19 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id iu8sm9278467pbc.71.2012.11.20.21.25.16 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 21:25:18 -0800 (PST) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/1] tty: vt: Remove redundant null check before kfree. Date: Wed, 21 Nov 2012 10:49:07 +0530 Message-Id: <1353475147-28308-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQnRekP7MwLo5+2VMdvnKOknhwul2erKAw2ndS9Nb3hPWL4712o55QCLlmm7GjaEfppI7mI7 kfree on a NULL pointer is a no-op. Signed-off-by: Sachin Kamat --- drivers/tty/vt/consolemap.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c index 2aaa0c2..248381b 100644 --- a/drivers/tty/vt/consolemap.c +++ b/drivers/tty/vt/consolemap.c @@ -410,10 +410,8 @@ static void con_release_unimap(struct uni_pagedir *p) kfree(p->inverse_translations[i]); p->inverse_translations[i] = NULL; } - if (p->inverse_trans_unicode) { - kfree(p->inverse_trans_unicode); - p->inverse_trans_unicode = NULL; - } + kfree(p->inverse_trans_unicode); + p->inverse_trans_unicode = NULL; } /* Caller must hold the console lock */