commit | 1f3bd508da15b8336d39e6a3b87fbfcc71eb001a | [log] [tgz] |
---|---|---|
author | Levente Kurusa <levex@linux.com> | Tue Aug 25 14:32:02 2015 +1000 |
committer | Stephen Rothwell <sfr@canb.auug.org.au> | Wed Aug 26 16:46:12 2015 +1000 |
tree | ca3b2205be2eec2ecd91f7299a564cc4ba879c2c | |
parent | 18be742a703c4027ce1d6715e619fa8d8b54d379 [diff] |
drivers/w1/w1_int.c: call put_device if device_register fails Currently, memsetting and kfreeing the device is bad behaviour. The device will have a reference count of 1 and hence can cause trouble because it has kfree'd. Proper way to handle a failed device_register is to call put_device right after it fails. Signed-off-by: Levente Kurusa <levex@linux.com> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>