linux/drivers/base/power
John Keeping 5f328a5b41 PM / QoS: Fix memory leak on resume_latency.notifiers
commit e84b4a84e5 upstream.

Since commit 2d984ad132 (PM / QoS: Introcuce latency tolerance device
PM QoS type) we reassign "c" to point at qos->latency_tolerance before
freeing c->notifiers, but the notifiers field of latency_tolerance is
never used.

Restore the original behaviour of freeing the notifiers pointer on
qos->resume_latency, which is used, and fix the following kmemleak
warning.

unreferenced object 0xed9dba00 (size 64):
  comm "kworker/0:1", pid 36, jiffies 4294670128 (age 15202.983s)
  hex dump (first 32 bytes):
    00 00 00 00 04 ba 9d ed 04 ba 9d ed 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<c06f6084>] kmemleak_alloc+0x74/0xb8
    [<c011c964>] kmem_cache_alloc_trace+0x170/0x25c
    [<c035f448>] dev_pm_qos_constraints_allocate+0x3c/0xe4
    [<c035f574>] __dev_pm_qos_add_request+0x84/0x1a0
    [<c035f6cc>] dev_pm_qos_add_request+0x3c/0x54
    [<c03c3fc4>] usb_hub_create_port_device+0x110/0x2b8
    [<c03b2a60>] hub_probe+0xadc/0xc80
    [<c03bb050>] usb_probe_interface+0x1b4/0x260
    [<c035773c>] driver_probe_device+0x198/0x40c
    [<c0357b14>] __device_attach_driver+0x8c/0x98
    [<c0355bbc>] bus_for_each_drv+0x8c/0x9c
    [<c0357494>] __device_attach+0x98/0x138
    [<c0357c64>] device_initial_probe+0x14/0x18
    [<c03569dc>] bus_probe_device+0x30/0x88
    [<c0354c54>] device_add+0x430/0x554
    [<c03b92d8>] usb_set_configuration+0x660/0x6fc

Fixes: 2d984ad132 (PM / QoS: Introcuce latency tolerance device PM QoS type)
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2017-06-05 21:17:11 +01:00
..
clock_ops.c PM / clk: Fix crash in clocks management code if !CONFIG_PM_RUNTIME 2014-11-03 10:52:06 +00:00
common.c drivers/base: delete non-required instances of include <linux/init.h> 2014-02-14 14:31:37 -08:00
domain.c arch: Mass conversion of smp_mb__*() 2014-04-18 14:20:48 +02:00
domain_governor.c drivers/base: delete non-required instances of include <linux/init.h> 2014-02-14 14:31:37 -08:00
generic_ops.c PM / Runtime: Spelling s/competing/completing/ 2014-03-26 16:33:53 +01:00
main.c PM / sleep: don't suspend parent when async child suspend_{noirq, late} fails 2017-02-23 03:54:32 +00:00
Makefile PM: Add pm_runtime_suspend|resume_force functions 2014-03-02 00:18:15 +01:00
opp.c Merge branch 'pm-cpufreq' 2014-06-03 23:13:20 +02:00
power.h PM / QoS: Rename device resume latency QoS items 2014-02-11 00:35:23 +01:00
qos.c PM / QoS: Fix memory leak on resume_latency.notifiers 2017-06-05 21:17:11 +01:00
runtime.c PM / Runtime: Fix error path in pm_runtime_force_resume() 2016-08-22 22:37:51 +01:00
sysfs.c PM / QoS: Introcuce latency tolerance device PM QoS type 2014-02-11 00:35:38 +01:00
trace.c drivers/base: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required. 2011-10-31 19:31:38 -04:00
wakeup.c PM / sleep: unregister wakeup source when disabling device wakeup 2014-05-30 13:39:29 +02:00