All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers: tty: Remove redundant memset() in initialize_tty_struct
Date: Thu, 10 Jul 2014 18:22:15 +0200	[thread overview]
Message-ID: <53BEBDB7.9080302@suse.cz> (raw)
In-Reply-To: <1405008984-12307-1-git-send-email-linux@rasmusvillemoes.dk>

On 07/10/2014 06:16 PM, Rasmus Villemoes wrote:
> All callers (all two) of initialize_tty_struct() have just obtained
> the passed tty_struct from alloc_tty_struct(), which uses
> kzalloc(). So there is no reason to clear the memory again.

Actually I don't see a reason to have initialize_tty_struct as a
separate function. In both cases it is called after alloc_tty_struct. So
it would make sense to move the initialization to alloc_tty_struct. (And
move try_module_get before alloc_tty_struct in pty_common_install.)

Could you do that?

-- 
js
suse labs

  reply	other threads:[~2014-07-10 16:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-10 16:16 [PATCH] drivers: tty: Remove redundant memset() in initialize_tty_struct Rasmus Villemoes
2014-07-10 16:22 ` Jiri Slaby [this message]
2014-07-10 19:01   ` [PATCH] drivers: tty: Merge alloc_tty_struct and initialize_tty_struct Rasmus Villemoes
2014-07-12 10:55     ` [PATCH v2] " Rasmus Villemoes
2014-07-12 12:16       ` Dan Carpenter
2014-07-12 16:47         ` Greg Kroah-Hartman
2014-07-12 23:44           ` [PATCH] drivers: tty: Fix use-after-free in pty_common_install Rasmus Villemoes

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=53BEBDB7.9080302@suse.cz \
    --to=jslaby@suse.cz \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.