gpio: mockup: fix a potential crash when creating debugfs entries
authorBartosz Golaszewski <brgl@bgdev.pl>
Sun, 4 Mar 2018 12:45:51 +0000 (13:45 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 27 Mar 2018 13:18:20 +0000 (15:18 +0200)
commit6cb9215baeb9c1ed336a5e8905f7ad7c4698acc9
tree2326844d2fc8c9504fc49fdd27d4f0ad2234af1d
parent3a711e0dd4e68f6b202db3f9e2c0086a8780da25
gpio: mockup: fix a potential crash when creating debugfs entries

If we failed to create the top debugfs directory, we must not try to
create the child nodes. We currently only check if gpio_mockup_dbg_dir
is not NULL, but it can also contain an errno if debugfs is disabled
in build options. Use IS_ERR_OR_NULL() instead.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-mockup.c