mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
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 <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
parent
3a711e0dd4
commit
6cb9215bae
1 changed files with 1 additions and 1 deletions
|
|
@ -314,7 +314,7 @@ static int gpio_mockup_probe(struct platform_device *pdev)
|
|||
if (rv)
|
||||
return rv;
|
||||
|
||||
if (gpio_mockup_dbg_dir)
|
||||
if (!IS_ERR_OR_NULL(gpio_mockup_dbg_dir))
|
||||
gpio_mockup_debugfs_setup(dev, chip);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue