From patchwork Thu Mar 28 07:53:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 2355161 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 68011DF2A1 for ; Thu, 28 Mar 2013 08:05:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751259Ab3C1IFJ (ORCPT ); Thu, 28 Mar 2013 04:05:09 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:51399 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095Ab3C1IFI (ORCPT ); Thu, 28 Mar 2013 04:05:08 -0400 Received: by mail-pa0-f48.google.com with SMTP id lj1so1390670pab.21 for ; Thu, 28 Mar 2013 01:05:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=UJQHeLU/i2x9U//2vIiq74N7LDWnCAzAmLP9TROspjw=; b=chqJ65lkGfuFSu3GIVpUI05gY4F3ZRHmzg2myqn7bAtoT9TW6dMeDoZysXQ6aMFDZR aXa3rhcoyyFz0Y1FurWt2NR9GIDzKY/yMGw4K8JIc3vmqWzvJE9E0tkkQX/ifjs1ZrB8 C7sQFOMZrlJ0ljNSOYCu3a3TutskfNTGIWaG5oA7JViW587jL5owNQPsMXb2d2PFoPcW pV094/nfzMPwmhsig9vQlpYBCD4vLKqfmsMcvASYMyl85Oog9XxMpbZH2dpCRGRrPw1C 0ywxuduv9RFui80azrCbNAYDkUmVA9cmY8opXi6zZujhrNtzZ5/cxDtmMbomfaucTLHZ jd0A== X-Received: by 10.66.184.203 with SMTP id ew11mr34857502pac.73.1364457907563; Thu, 28 Mar 2013 01:05:07 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id oq3sm26743190pac.16.2013.03.28.01.05.05 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 28 Mar 2013 01:05:06 -0700 (PDT) From: Sachin Kamat To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com, sachin.kamat@linaro.org Subject: [PATCH 1/2] Input: edt-ft5x06 - Remove redundant null check before kfree Date: Thu, 28 Mar 2013 13:23:41 +0530 Message-Id: <1364457222-4381-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQlLmX58QYaW9mRx0WzMVxlLuuhE24pr2vPbCMiZrs1Zkw4KawpozC7ZUQPYxqGgagTPG/UM Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org kfree on a null pointer is a no-op. Hence null check is not necessary. Signed-off-by: Sachin Kamat --- drivers/input/touchscreen/edt-ft5x06.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index a917015..83fa1b1 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -440,8 +440,7 @@ static int edt_ft5x06_work_mode(struct edt_ft5x06_ts_data *tsdata) return -EIO; } - if (tsdata->raw_buffer) - kfree(tsdata->raw_buffer); + kfree(tsdata->raw_buffer); tsdata->raw_buffer = NULL; /* restore parameters */