diff options
author | Xiaoke Wang <xkernel.wang@foxmail.com> | 2022-01-17 10:06:06 +0300 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2022-01-24 18:23:15 +0300 |
commit | c84eab5850d11bea546491bb1798039448971141 (patch) | |
tree | 3ca0044aef6715d2e7d899e4c8d7804b96108fff /tools/perf/scripts/python/stat-cpi.py | |
parent | 06608bc2d9e6f5a24baf51951e9e2fff3ec78e54 (diff) | |
download | linux-c84eab5850d11bea546491bb1798039448971141.tar.xz |
gpio: merrifield: check the return value of devm_kstrdup()
devm_kstrdup() returns pointer to allocated string on success, NULL on
failure. So it is better to check the return value of it.
Before, if devm_kstrdup() fails, pinctrl_dev_name will be NULL, then the
retval below will be a negative error-code (inside gpiochip_add_pin_range(),
pinctrl_find_and_add_gpio_range()->get_pinctrl_dev_from_devname() will
finally check pinctrl_dev_name and return an error), so the failure of
devm_kstrdup() can be only implicitly caught after a long call chain.
While this patch is to explicitly catch the failure in time.
Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'tools/perf/scripts/python/stat-cpi.py')
0 files changed, 0 insertions, 0 deletions