Subject: Re: [PATCH v2] ethtool: do not vzalloc(0) on registers dump

From: Stanislaw Gruszka <[email-masked]>
Date: Thu, 2 Feb 2017 16:03:10 +0100

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