Re: [PATCH 3/3] flex_array: allow 0 length elements

From: Dave Hansen
Date: Tue Apr 26 2011 - 16:46:43 EST


On Mon, 2011-04-25 at 21:45 -0400, Eric Paris wrote:
> allow elements of 0 length. We already allow flex_arrays with 0
> elements, but
> this patch allow us to have elements that are 0 bytes long.
>
> Based-on-patch-by: Steffen Klassert <steffen.klassert@xxxxxxxxxxx>
> Signed-off-by: Eric Paris <eparis@xxxxxxxxxx>

I'd like to see a bit of the history in the changelog. kmalloc(0)
returns NULL, and we'd effectively like to do the same since flex_arrays
really are like a mini allocator. The 0-sized elements come from
userspace and we *have* to handle them in the security code, etc...

The code looks good, though.

Acked-by: Dave Hansen <dave@xxxxxxxxxxxxxxxxxx>

-- Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/