power_supply: Fix use after free and memory leak
authorVasiliy Kulikov <segoon@openwall.com>
Fri, 19 Nov 2010 18:41:58 +0000 (21:41 +0300)
committerAnton Vorontsov <cbouatmailru@gmail.com>
Tue, 21 Dec 2010 23:39:55 +0000 (02:39 +0300)
device_unregister() might free its argument.  This leads to freed
memory use in kfree().  Also use put_device() instead of kfree()
as dev may be already used in another layer after call to device_add().

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>

No differences found