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)
committerWolfram Sang <wsa@kernel.org>
Sat, 19 Feb 2022 11:37:20 +0000 (12:37 +0100)
commit8302532f47bb6c3aa1ed2043d30187ca307f176a
tree1993cb506fa7e5abcf281c502d1f9163bd21e1c9
parent017b32e6da8d4a9673bf68ab4ac1260ef74e9695
i2c: smbus: Check for parent device before dereference

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>
drivers/i2c/i2c-core-smbus.c