linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: byd: don't wipe dynamically allocated memory twice
@ 2016-04-21 19:58 Vladimir Zapolskiy
  2016-04-26 16:50 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Zapolskiy @ 2016-04-21 19:58 UTC (permalink / raw)
  To: Dmitry Torokhov, Richard Pospesel, Chris Diamand; +Cc: linux-input

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 <vz@mleia.com>
---
 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;
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-26 16:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-21 19:58 [PATCH] Input: byd: don't wipe dynamically allocated memory twice Vladimir Zapolskiy
2016-04-26 16:50 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).