commit | f23b2424ac496242009a67d9aea3c9ca5142023b | [log] [tgz] |
---|---|---|
author | Levente Kurusa <levex@linux.com> | Fri Jun 05 15:10:53 2015 +1000 |
committer | Michael Ellerman <mpe@ellerman.id.au> | Fri Jun 05 22:54:45 2015 +1000 |
tree | 379e109ab3473d3bd0cc554fb4397d3c8bb54610 | |
parent | cfb3fabb5c2cebcfd5284367a271fede6c561a51 [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>