Skip to content
Commit bf69d41d authored by Eric Paris's avatar Eric Paris
Browse files

flex_arrays: allow zero length flex arrays



Just like kmalloc will allow one to allocate a 0 length segment of memory
flex arrays should do the same thing.  It should bomb if you try to use
something, but it should at least allow the allocation.

This is needed because when SELinux switched to using flex_arrays in 2.6.38
the inability to allocate a 0 length array resulted in SELinux policy load
returning -ENOSPC when previously it worked.

Based-on-patch-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: default avatarEric Paris <eparis@redhat.com>
Tested-by: default avatarChris Richards <gizmo@giz-works.com>
Cc: stable@kernel.org [2.6.38+]
parent 5d30b10b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment