Thread (1 message) 1 message, 1 author, 2013-02-04

Re: [PATCH v2 4/4] iio: Add OF support

From: Guenter Roeck <hidden>
Date: 2013-02-04 16:37:04
Also in: linux-iio

On Sun, Feb 03, 2013 at 08:22:13AM -0800, Guenter Roeck wrote:
[ ... ]
quoted
quoted
+
+	/* NULL terminated array to save passing size */
+	chans = kzalloc(sizeof(*chans)*(nummaps + 1), GFP_KERNEL);
I think using kcalloc makes sense here.
that would leave chan->data uninitialized, and I would have to initialize it
explicitly. also, if additional fields are ever added, we would risk having
uninitialized fields. Using kzalloc avoids a potential future error case, so I
would prefer to keep it.
Please ignore this one.

Looks like my brain was too flu-foggy to realize that kcalloc does clear the
memory.

Guenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help