From patchwork Tue Nov 20 09:07:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 12975 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 974A823FC8 for ; Tue, 20 Nov 2012 09:13:16 +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 43650A18FA2 for ; Tue, 20 Nov 2012 09:13:16 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so7842538iej.11 for ; Tue, 20 Nov 2012 01:13:15 -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=5izvv4Bu/ZsU7muSnY5/blYkfXjgqwSyxHM0sP12XSc=; b=apECf0k/KnoSXyTb48m3+9nBmLT5WiE64iLqPDhZMkHltaXrZWGK6KTxJSg7+eBgll 38gOrx5JkA6vQiGLGa4A2CCFIdHiKtRfiRZE2vu1KQPD6NsNtjS6/wsaQ1LQ56H1gUUU GQqNowaFZgL7l+i44ksE4l5nKGYRncAR0PmqPS0A5WFNzJd3eOB86p+2dADQWm5zcZWS oBG0qJ7QvVosu8gLTayMzpq4HVzvXG88PKIBByVWfMxSnhsYQPsw7qg7GcxICfIBcxVW 8ZYBADrCErAJtnBbpRi62McsM+CXKe2L+C530NBbvlfrVmIdvX0B/KPJA59jwsyFYLcn 8uKw== Received: by 10.50.91.195 with SMTP id cg3mr9274475igb.57.1353402795567; Tue, 20 Nov 2012 01:13:15 -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 n20csp290092igt; Tue, 20 Nov 2012 01:13:15 -0800 (PST) Received: by 10.68.245.167 with SMTP id xp7mr47777066pbc.75.1353402795030; Tue, 20 Nov 2012 01:13:15 -0800 (PST) Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by mx.google.com with ESMTPS id mo5si17450276pbc.268.2012.11.20.01.13.14 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 01:13:15 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.48 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.48; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.48 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-pb0-f48.google.com with SMTP id rq13so3608263pbb.7 for ; Tue, 20 Nov 2012 01:13:14 -0800 (PST) Received: by 10.68.254.137 with SMTP id ai9mr40787341pbd.21.1353402794731; Tue, 20 Nov 2012 01:13:14 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id g1sm7758551pax.21.2012.11.20.01.13.11 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 01:13:14 -0800 (PST) From: Sachin Kamat To: linux-fbdev@vger.kernel.org Cc: FlorianSchandinat@gmx.de, akpm@linux-foundation.org, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/1] video: softcursor: Remove redundant NULL check before kfree Date: Tue, 20 Nov 2012 14:37:05 +0530 Message-Id: <1353402425-23120-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQmhtcF5kGUZnzO3MR3vSG8HE0/XdbXK/0/XgIyatSOnnoV815icrrfqZzwEQvFn7+7Xhx6y kfree on a NULL pointer is a no-op. Signed-off-by: Sachin Kamat --- drivers/video/console/softcursor.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/video/console/softcursor.c b/drivers/video/console/softcursor.c index 25f835b..46dd8f5 100644 --- a/drivers/video/console/softcursor.c +++ b/drivers/video/console/softcursor.c @@ -35,8 +35,7 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor) dsize = s_pitch * cursor->image.height; if (dsize + sizeof(struct fb_image) != ops->cursor_size) { - if (ops->cursor_src != NULL) - kfree(ops->cursor_src); + kfree(ops->cursor_src); ops->cursor_size = dsize + sizeof(struct fb_image); ops->cursor_src = kmalloc(ops->cursor_size, GFP_ATOMIC);