[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 2 Feb 2017 16:03:10 +0100
From: Stanislaw Gruszka <sgruszka@...hat.com>
To: "John W. Linville" <linville@...driver.com>
Cc: netdev@...r.kernel.org, Ben Hutchings <ben@...adent.org.uk>
Subject: Re: [PATCH v2] ethtool: do not vzalloc(0) on registers dump
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
Powered by blists - more mailing lists