platform/x86: intel_menlow: avoid null pointer deference error
authorYoung Xiao <92siuyang@gmail.com>
Wed, 29 May 2019 01:55:51 +0000 (09:55 +0800)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 12 Jun 2019 09:42:27 +0000 (12:42 +0300)
commit92a74ce3c466011375bdf8282e64b13a7052aee8
tree4b25dc231b59b718bf7f677ab688befc982fc3f5
parent8d4b2daff2567ac189a83ed99aa2f0338afbd5f0
platform/x86: intel_menlow: avoid null pointer deference error

Fix a null pointer deference by acpi_driver_data() if device is
null (dereference before check). We should only set cdev and check
this is OK after we are sure device is not null.

Signed-off-by: Young Xiao <92siuyang@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/intel_menlow.c