From patchwork Thu Apr 21 19:58:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 8903631 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 83671BF29F for ; Thu, 21 Apr 2016 19:58:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C0A1220303 for ; Thu, 21 Apr 2016 19:58:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D117D2015E for ; Thu, 21 Apr 2016 19:58:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751571AbcDUT6X (ORCPT ); Thu, 21 Apr 2016 15:58:23 -0400 Received: from mleia.com ([178.79.152.223]:56892 "EHLO mail.mleia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751485AbcDUT6X (ORCPT ); Thu, 21 Apr 2016 15:58:23 -0400 Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id 33DF941BE51; Thu, 21 Apr 2016 21:03:47 +0100 (BST) Received: from meadow.home (a91-152-14-233.elisa-laajakaista.fi [91.152.14.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mleia.com (Postfix) with ESMTPSA id B8A0541A84D; Thu, 21 Apr 2016 21:03:46 +0100 (BST) From: Vladimir Zapolskiy To: Dmitry Torokhov , Richard Pospesel , Chris Diamand Cc: linux-input@vger.kernel.org Subject: [PATCH] Input: byd: don't wipe dynamically allocated memory twice Date: Thu, 21 Apr 2016 22:58:17 +0300 Message-Id: <1461268697-30735-1-git-send-email-vz@mleia.com> X-Mailer: git-send-email 2.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20160421_210347_235639_148C5708 X-CRM114-Status: UNSURE ( 8.38 ) X-CRM114-Notice: Please train this message. Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since memory for a private data is allocated by kzalloc() there is no need to fill it with zeroes immediately after the allocation. Signed-off-by: Vladimir Zapolskiy --- drivers/input/mouse/byd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/mouse/byd.c b/drivers/input/mouse/byd.c index fdc243c..ec73f75 100644 --- a/drivers/input/mouse/byd.c +++ b/drivers/input/mouse/byd.c @@ -473,9 +473,8 @@ int byd_init(struct psmouse *psmouse) priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; - memset(priv, 0, sizeof(*priv)); setup_timer(&priv->timer, byd_clear_touch, (unsigned long) psmouse); psmouse->private = priv; psmouse->disconnect = byd_disconnect;