ACPI / fan: avoid null pointer deference error
ACPI / fan: avoid null pointer deference error

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

Smatch analysis:

drivers/acpi/fan.c:179 acpi_fan_remove() warn: variable dereferenced
  before check 'device' (see line 177)

Signed-off-by: Colin Ian King <d100aa70785e45ee8deab668147d941941915c21@canonical.com>
Signed-off-by: Rafael J. Wysocki <27ffc44a8ec6a212fba98cfc3246c6ce8ab131e0@intel.com>

TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas