All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: netdev@vger.kernel.org, Ben Hutchings <ben@decadent.org.uk>
Subject: Re: [PATCH v2] ethtool: do not vzalloc(0) on registers dump
Date: Thu, 2 Feb 2017 16:03:10 +0100	[thread overview]
Message-ID: <20170202150309.GA16027@redhat.com> (raw)
In-Reply-To: <20170202142717.GA22745@tuxdriver.com>

On Thu, Feb 02, 2017 at 09:27:18AM -0500, John W. Linville wrote:
> > -	regbuf = vzalloc(reglen);
> > -	if (reglen && !regbuf)
> > -		return -ENOMEM;
> > +	regbuf = NULL;
> 
> Any reason to prefer this over changing the declaration to include
> the assignment?
> 
> 	void *regbuf = NULL;

I've chosen this form to have initialization near the vzalloc() call,
after sanity checks, however I don't think it's better or worse over
declaration initialization.

Stanislaw

  reply	other threads:[~2017-02-02 15:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02 12:32 [PATCH v2] ethtool: do not vzalloc(0) on registers dump Stanislaw Gruszka
2017-02-02 14:27 ` John W. Linville
2017-02-02 15:03   ` Stanislaw Gruszka [this message]
2017-02-03 16:11 ` David Miller

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=20170202150309.GA16027@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=ben@decadent.org.uk \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    /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.