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: 1772011 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 0A0B43FC5A for ; Tue, 20 Nov 2012 09:13:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752103Ab2KTJNQ (ORCPT ); Tue, 20 Nov 2012 04:13:16 -0500 Received: from mail-da0-f46.google.com ([209.85.210.46]:61572 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751698Ab2KTJNP (ORCPT ); Tue, 20 Nov 2012 04:13:15 -0500 Received: by mail-da0-f46.google.com with SMTP id p5so1158120dak.19 for ; Tue, 20 Nov 2012 01:13:14 -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:x-gm-message-state; bh=5izvv4Bu/ZsU7muSnY5/blYkfXjgqwSyxHM0sP12XSc=; b=delhn9iY0AvSga6dTkVHN9IGJbm4gnsj4RMXQrW87YZHsV9pbekMTCFrJdMS1Z0SeH lt8E3SOfPQTgn//U+CKPF1HT+fApfGY1havXRg3RT6N1XM0XUsdvNyPUXC8K/YQaFHVW 8sPcmPYhDkdRbYmu+5MMPWIFyRjK3sD9ICDyTRNvT/gDaphryYVocJUiiOhlklHp+cNm bguggGZVPqDRMfFeUUusLoydXg9kCHAwHySqwq4i5oOKOdAzeIknHgLAfNyccne28eg6 MgFGfWUn2b/qB1tKI/WJ96NxM/WY1TLSSian2DJRngzKiMxhnwwzf4OQAHqF7XJ6wPea PJUg== 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: ALoCoQkaS70q3XrD9mIw8hKsxcxnkaY6rKXb5EFXFss9VHczj5Ov6xIioE/tHir2e8dfxlf7zEVH Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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);