| commit | f93d6339a169694294942c469092cfe62f203753 | [log] [tgz] |
|---|---|---|
| author | Levente Kurusa <levex@linux.com> | Thu May 14 10:58:53 2015 +1000 |
| committer | Stephen Rothwell <sfr@canb.auug.org.au> | Thu May 14 17:37:43 2015 +1000 |
| tree | 96cb652172c596ec52eace385a68973b5c888ec6 | |
| parent | a239aa494c2cd1b8924d3552045c1909a07721f6 [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>