]> git.baikalelectronics.ru Git - kernel.git/commit
mfd: Fix memleak in pcf50633_client_dev_register
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 13 Oct 2009 22:12:33 +0000 (02:12 +0400)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 13 Dec 2009 18:21:17 +0000 (19:21 +0100)
commit1d9bdb4a714dc2a37d82cc721991794a3c4311be
treea916769e71d50c0d20725cad60fb0402da198692
parent0ecfa4a4f032cb6d819c9babddf17897a24ffc58
mfd: Fix memleak in pcf50633_client_dev_register

Since platform_device_add_data copies the passed data, the allocated
subdev_pdata is never freed. A simple fix would be to either free subdev_pdata
or put it onto the stack. But since the pcf50633 child devices can rely on
beeing children of the pcf50633 core device it's much more elegant to get access
to pcf50633 core structure through that link. This allows to get completly rid
of pcf5033_subdev_pdata.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/input/misc/pcf50633-input.c
drivers/mfd/pcf50633-adc.c
drivers/mfd/pcf50633-core.c
drivers/power/pcf50633-charger.c
drivers/rtc/rtc-pcf50633.c
include/linux/mfd/pcf50633/core.h