Andy Shevchenko aa5ae06515 i2c: i801: Fix kernel crash in is_dell_system_with_lis3lv02d()
The commit

  19b07cb4a187 ("i2c: i801: Register optional lis3lv02d I2C device on Dell machines")

introduced a new check in order to enumerate some slave devices on Dell
machines. Though, it brings a regression on machines where DMI vendor is not set.

 BUG: kernel NULL pointer dereference, address: 0000000000000000
 #PF: supervisor read access in kernel mode
 #PF: error_code(0x0000) - not-present page
 PGD 0 P4D 0
 Oops: 0000 [#1] SMP PTI
 CPU: 8 PID: 1 Comm: swapper/0 Not tainted 5.2.0-rc4-next-20190613+ #317
 RIP: 0010:strcmp+0xc/0x20

To fix this crash, check if vendor field is present before accessing to it.

Fixes: 19b07cb4a187 ("i2c: i801: Register optional lis3lv02d I2C device on Dell machines")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2019-06-14 23:24:33 +02:00
..
2019-05-24 11:03:26 -07:00
2019-05-16 09:19:14 -07:00
2019-05-21 12:33:38 -07:00
2019-05-25 10:11:23 -07:00
2019-06-12 13:20:23 +02:00
2019-05-24 14:31:58 -07:00
2019-05-25 10:11:23 -07:00
2019-05-24 14:31:58 -07:00
2019-05-24 14:31:58 -07:00
2019-05-25 10:11:23 -07:00
2019-05-24 16:02:14 -07:00
2019-05-14 10:30:10 -07:00
2019-05-22 08:36:16 -07:00
2019-05-24 17:30:28 -07:00