commit | f19b1de5c28996af23d0292051dac5dc56559b75 | [log] [tgz] |
---|---|---|
author | Levente Kurusa <levex@linux.com> | Thu Jul 30 09:57:59 2015 +1000 |
committer | Stephen Rothwell <sfr@canb.auug.org.au> | Wed Aug 05 17:05:44 2015 +1000 |
tree | 7eac1ceb18f481f0722d04d32f582a2dec9cc908 | |
parent | 242adcb8835cde1d0120ca47ec9b578de13516b5 [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>