From patchwork Fri Sep 10 17:14:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrik Rydberg X-Patchwork-Id: 64434 X-Patchwork-Delegate: leann.ogasawara@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 52D0EB70F3 for ; Sat, 11 Sep 2010 03:15:33 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1Ou7CC-0003rY-Al; Fri, 10 Sep 2010 18:15:28 +0100 Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1Ou7CA-0003qp-Bc for kernel-team@lists.ubuntu.com; Fri, 10 Sep 2010 18:15:26 +0100 Received: from c83-248-196-134.bredband.comhem.se ([83.248.196.134]:54297 helo=alnilam) by ch-smtp02.sth.basefarm.net with smtp (Exim 4.68) (envelope-from ) id 1Ou7Bo-0007N8-71 for kernel-team@lists.ubuntu.com; Fri, 10 Sep 2010 19:15:07 +0200 Received: by alnilam (sSMTP sendmail emulation); Fri, 10 Sep 2010 19:15:04 +0200 From: "Henrik Rydberg" To: kernel-team@lists.ubuntu.com Subject: [PATCH 10/13] hid: ntrig: zero-initialize ntrig struct Date: Fri, 10 Sep 2010 19:14:16 +0200 Message-Id: <1284138859-32673-11-git-send-email-rydberg@euromail.se> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1284138859-32673-1-git-send-email-rydberg@euromail.se> References: <1284138859-32673-1-git-send-email-rydberg@euromail.se> X-Originating-IP: 83.248.196.134 X-Scan-Result: No virus found in message 1Ou7Bo-0007N8-71. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1Ou7Bo-0007N8-71 a0c53ad8d61e4786ab55911193dba520 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com Setting zeros using kzalloc instead. Signed-off-by: Henrik Rydberg --- drivers/hid/hid-ntrig.c | 10 +--------- 1 files changed, 1 insertions(+), 9 deletions(-) diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c index 403503c..fbb68d2 100644 --- a/drivers/hid/hid-ntrig.c +++ b/drivers/hid/hid-ntrig.c @@ -482,23 +482,15 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) if (id->driver_data & NTRIG_DUPLICATE_USAGES) hdev->quirks |= HID_QUIRK_MULTI_INPUT; - nd = kmalloc(sizeof(struct ntrig_data), GFP_KERNEL); + nd = kzalloc(sizeof(struct ntrig_data), GFP_KERNEL); if (!nd) { dev_err(&hdev->dev, "cannot allocate N-Trig data\n"); return -ENOMEM; } - nd->reading_mt = 0; - nd->min_width = 0; - nd->min_height = 0; nd->activate_slack = activate_slack; nd->act_state = activate_slack; nd->deactivate_slack = -deactivate_slack; - nd->sensor_logical_width = 0; - nd->sensor_logical_height = 0; - nd->sensor_physical_width = 0; - nd->sensor_physical_height = 0; - hid_set_drvdata(hdev, nd); ret = hid_parse(hdev);