From patchwork Thu Aug 4 20:43:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bojan Prtvar X-Patchwork-Id: 1036782 X-Patchwork-Delegate: jikos@jikos.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p74KllE5012701 for ; Thu, 4 Aug 2011 20:47:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753971Ab1HDUn7 (ORCPT ); Thu, 4 Aug 2011 16:43:59 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:59698 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753234Ab1HDUn7 (ORCPT ); Thu, 4 Aug 2011 16:43:59 -0400 Received: by fxh19 with SMTP id 19so2101256fxh.19 for ; Thu, 04 Aug 2011 13:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=62qMIwMWneNbfQ/Th1qyeSQhuLjIqUVy88rihY28Ooc=; b=jwSKIhGs8ihNnwYFiYZvAHpfMc3+wt0CemBIuy0xWjaMl7TsmRFqyamsPWoWhIVIls K6cheswPa/kl7/fUyTT28bN6xX/Q0pkylpEjCCzg/UrVCx7UQvEjJjIOiOIe+HY//dNU GfH26n/m0Xh4UsN8TAkfvyCQ869/XdFi+wyrA= Received: by 10.223.13.69 with SMTP id b5mr1792168faa.1.1312490637613; Thu, 04 Aug 2011 13:43:57 -0700 (PDT) Received: from localhost.localdomain (109-93-49-6.dynamic.isp.telekom.rs [109.93.49.6]) by mx.google.com with ESMTPS id y15sm1480465fah.35.2011.08.04.13.43.56 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 04 Aug 2011 13:43:56 -0700 (PDT) From: Bojan Prtvar To: jkosina@suse.cz Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Bojan Prtvar Subject: [PATCH 2/2] HID: kfree() NULL pointer cleanup Date: Thu, 4 Aug 2011 22:43:46 +0200 Message-Id: <1312490626-14838-1-git-send-email-prtvar.b@gmail.com> X-Mailer: git-send-email 1.7.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 04 Aug 2011 20:47:48 +0000 (UTC) Checking for NULL pointers before kfree() is redundant. Signed-off-by: Bojan Prtvar --- drivers/hid/hid-zydacron.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-zydacron.c b/drivers/hid/hid-zydacron.c index e903715..1ad85f2 100644 --- a/drivers/hid/hid-zydacron.c +++ b/drivers/hid/hid-zydacron.c @@ -201,9 +201,7 @@ static void zc_remove(struct hid_device *hdev) struct zc_device *zc = hid_get_drvdata(hdev); hid_hw_stop(hdev); - - if (NULL != zc) - kfree(zc); + kfree(zc); } static const struct hid_device_id zc_devices[] = {