]> asedeno.scripts.mit.edu Git - linux.git/commit
of: unittest: Remove VLA stack usage
authorTobin C. Harding <me@tobin.cc>
Mon, 12 Mar 2018 04:27:23 +0000 (15:27 +1100)
committerRob Herring <robh@kernel.org>
Sat, 17 Mar 2018 23:52:41 +0000 (18:52 -0500)
commitd4b9e425d23a2c38e2cc52f62c79773ccff0ecc4
treefcca145013ecfb441fa9b6fca94b84ad3c9042b3
parenta514266ba675b28ff223ecd1fc431810ec828337
of: unittest: Remove VLA stack usage

The kernel would like to have all stack VLA usage removed[1].  This is a
test function so the execution speed is not critical.  We can allocate
memory for this buffer instead of using a VLA.  If kmalloc() fails just
return.

Allocate buffer with kmalloc().

[1]: https://lkml.org/lkml/2018/3/7/621

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/unittest.c