linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Vladimir Zapolskiy <vz@mleia.com>
Cc: Richard Pospesel <pospeselr@gmail.com>,
	Chris Diamand <chris@diamand.org>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH] Input: byd: don't wipe dynamically allocated memory twice
Date: Tue, 26 Apr 2016 09:50:47 -0700	[thread overview]
Message-ID: <20160426165047.GC30010@dtor-ws> (raw)
In-Reply-To: <1461268697-30735-1-git-send-email-vz@mleia.com>

On Thu, Apr 21, 2016 at 10:58:17PM +0300, Vladimir Zapolskiy wrote:
> 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>

Applied, thank you.

> ---
>  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
> 

-- 
Dmitry

      reply	other threads:[~2016-04-26 16:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160426165047.GC30010@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=chris@diamand.org \
    --cc=linux-input@vger.kernel.org \
    --cc=pospeselr@gmail.com \
    --cc=vz@mleia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).