Loading
Input: adp5589-keys - fix NULL pointer dereference
stable inclusion from stable-v6.6.55 commit 7c3f04223aaf82489472d614c6decee5a1ce8d7f category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAYR9T CVE: CVE-2024-49871 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7c3f04223aaf82489472d614c6decee5a1ce8d7f -------------------------------- commit fb5cc65f973661241e4a2b7390b429aa7b330c69 upstream. We register a devm action to call adp5589_clear_config() and then pass the i2c client as argument so that we can call i2c_get_clientdata() in order to get our device object. However, i2c_set_clientdata() is only being set at the end of the probe function which means that we'll get a NULL pointer dereference in case the probe function fails early. Fixes: 30df385e ("Input: adp5589-keys - use devm_add_action_or_reset() for register clear") Signed-off-by:Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20241001-b4-dev-adp5589-fw-conversion-v1-1-fca0149dfc47@analog.com Cc: stable@vger.kernel.org Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Yi Yang <yiyang13@huawei.com>