• Colin Ian King's avatar
    ACPI / processor_thermal: avoid null pointer deference error · 99aa3638
    Colin Ian King authored
    Fix a null pointer deference by acpi_driver_data() if device is
    null.  We should only set pr and check this is OK after we are
    sure device is not null.
    
    Smatch analysis:
    
    drivers/acpi/processor_thermal.c:223 processor_get_max_state() warn:
      variable dereferenced before check 'device' (see line 221)
    drivers/acpi/processor_thermal.c:237 processor_get_cur_state() warn:
      variable dereferenced before check 'device' (see line 235)
    drivers/acpi/processor_thermal.c:255 processor_set_cur_state() warn:
      variable dereferenced before check 'device' (see line 251)
    Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    99aa3638
processor_thermal.c 6.85 KB