of: unittest: initialize args before calling of_*parse_*()
authorFrank Rowand <frank.rowand@sony.com>
Fri, 5 Oct 2018 03:40:21 +0000 (20:40 -0700)
committerFrank Rowand <frank.rowand@sony.com>
Fri, 9 Nov 2018 06:12:37 +0000 (22:12 -0800)
commiteeb07c573ec307c53fe2f6ac6d8d11c261f64006
treec6f825e39534e2b3e936cd358ad9316f324a6489
parent160b1d4e4127f0ef5d9ac281b6fa6ef1fb78c45f
of: unittest: initialize args before calling of_*parse_*()

Callers of of_irq_parse_one() blindly use the pointer args.np
without checking whether of_irq_parse_one() had an error and
thus did not set the value of args.np.  Initialize args to
zero so that using the format "%pOF" to show the value of
args.np will show "(null)" when of_irq_parse_one() has an
error.  This prevents the dereference of a random value.

Make the same fix for callers of of_parse_phandle_with_args()
and of_parse_phandle_with_args_map().

Reported-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Alan Tull <atull@kernel.org>
Signed-off-by: Frank Rowand <frank.rowand@sony.com>
drivers/of/unittest.c