]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
i2c: smbus: Check for parent device before dereference
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 4 Feb 2022 15:59:20 +0000 (17:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:12:01 +0000 (15:12 +0200)
commit7db54f3ba8cf45a8a3b97472a6f3703293195706
treea8465e3e94b75158c963862071981d87d7224ed0
parent63a07379fdb6c72450cb05294461c6016b8b7726
i2c: smbus: Check for parent device before dereference

commit 8302532f47bb6c3aa1ed2043d30187ca307f176a upstream.

An I²C adapter might be instantiated without parent. In such case
there is no property can be retrieved. Skip SMBus alert setup when
this happens.

Fixes: a263a84088f6 ("i2c: smbus: Use device_*() functions instead of of_*()")
Reported-by: syzbot+0591ccf54ee05344e4eb@syzkaller.appspotmail.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/i2c-core-smbus.c