mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Joonwoo Park" <joonwpark81@gmail.com>
To: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: netdev@vger.kernel.org, chas@cmf.nrl.navy.mil,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] atm/ambassador: kmalloc + memset conversion to kzalloc
Date: Mon, 26 Nov 2007 19:53:19 +0900	[thread overview]
Message-ID: <b25c3fa70711260253we514310g2652d40440dc514e@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.0.9999.0711260523420.12603@localhost.localdomain>

2007/11/26, Robert P. J. Day <rpjday@crashcourse.ca>:
> i realized that.  but all you can say is that only amb_init() calls
> setup_dev() *currently*.  when you're not looking, someone else might
> (for whatever reason) call setup_dev() from elsewhere, and *that* call
> might not zero that memory area.
>
> IMHO, the only safe transforms of kmalloc+memset -> kzalloc are those
> in which the flow of control is unmistakable and invariant.  splitting
> that across a function call seems like a dangerous thing to do.
> (except, of course, in the case, where the kzalloc() is added inside
> the function -- then all callers are entitled to simplify *their*
> code.  but that's different.)
>
> in any event, i just thought i'd point it out.  if you're absolutely
> sure there will never be another call to setup_dev() from somewhere
> else, then, yes, it's safe.
>

I understood your opinions. and partially agree with you.
But isn't it a unfounded fear?

Thanks
Joonwoo

  reply	other threads:[~2007-11-26 10:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-26  9:02 Joonwoo Park
2007-11-26  9:11 ` Robert P. J. Day
2007-11-26 10:23   ` Joonwoo Park
2007-11-26 10:29     ` Robert P. J. Day
2007-11-26 10:53       ` Joonwoo Park [this message]
2007-11-26 11:20         ` Robert P. J. Day
2007-11-27 14:40           ` chas williams - CONTRACTOR

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=b25c3fa70711260253we514310g2652d40440dc514e@mail.gmail.com \
    --to=joonwpark81@gmail.com \
    --cc=chas@cmf.nrl.navy.mil \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rpjday@crashcourse.ca \
    /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

all inboxes | Powered by JetHome®