summaryrefslogtreecommitdiff
path: root/tools/lib/python/feat/parse_features.py
diff options
context:
space:
mode:
authorwangdicheng <wangdicheng@kylinos.cn>2026-04-28 10:34:08 +0800
committerMark Brown <broonie@kernel.org>2026-04-28 12:40:32 +0900
commit241ee17ecb6be210f7b231b2a81bfb68871950d0 (patch)
treeac2afa99dc94058441bc7325f880d38fb48f1cfb /tools/lib/python/feat/parse_features.py
parent8ed3311131077712cdd0b3afec6909b9388ad3e4 (diff)
ASoC: aw88395: Fix kernel panic caused by invalid GPIO error pointer
In aw88395_i2c_probe(), if `devm_gpiod_get_optional()` fails, it returns an ERR_PTR() error pointer. The current code only prints a message and continues execution, leaving `aw88395->reset_gpio` as an invalid pointer. Later, in `aw88395_hw_reset()`, this invalid pointer is passed to `gpiod_set_value_cansleep()`, which dereferences it and causes a kernel panic. For optional GPIOs, `devm_gpiod_get_optional()` returns NULL if the GPIO is not defined in the DT, which is safe. If it returns an ERR_PTR, it means a real error occurred (e.g., -EPROBE_DEFER) and the probe must be aborted. Also, since the GPIO is optional, remove the dev_err() log in aw88395_hw_reset() when the GPIO is missing to match the optional semantics. This also fixes a potential NULL pointer dereference as aw_pa is not initialized when aw88395_hw_reset() is called. Signed-off-by: wangdicheng <wangdicheng@kylinos.cn> Link: https://patch.msgid.link/20260428023408.46420-1-wangdich9700@163.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/lib/python/feat/parse_features.py')
0 files changed, 0 insertions, 0 deletions