]> asedeno.scripts.mit.edu Git - linux.git/commit
iio: multiplexer: add NULL check on devm_kzalloc() and devm_kmemdup() return values
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Fri, 7 Jul 2017 04:53:11 +0000 (23:53 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 3 Sep 2017 17:10:29 +0000 (18:10 +0100)
commitdd92d5ea20ef8a42be7aeda08c669c586c730451
tree0f5a81bb6c4116cf56d9ae2f09f3008b78a5bb6c
parent9d2f715d592eb4d0e643f6219f4a160fbd62934d
iio: multiplexer: add NULL check on devm_kzalloc() and devm_kmemdup() return values

Check return values from call to devm_kzalloc() and devm_kmemup()
in order to prevent a NULL pointer dereference.

This issue was detected using Coccinelle and the following semantic patch:

@@
expression x;
identifier fld;
@@

* x = devm_kzalloc(...);
   ... when != x == NULL
   x->fld

Fixes: 7ba9df54b091 ("iio: multiplexer: new iio category and iio-mux driver")
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Acked-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/multiplexer/iio-mux.c