commit | 73f7c9fcf2f93c2a35983a06258325e02214c409 | [log] [tgz] |
---|---|---|
author | Levente Kurusa <levex@linux.com> | Wed Jul 23 09:13:14 2014 +1000 |
committer | Stephen Rothwell <sfr@canb.auug.org.au> | Fri Jul 25 19:34:19 2014 +1000 |
tree | 585248468cb906a9fc950f468b43005b9d2df735 | |
parent | f83a62d551eea85f13f01b183f8e38ece85d3a8c [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>