]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drivers/w1/w1_int.c: call put_device if device_register fails
authorLevente Kurusa <levex@linux.com>
Fri, 3 Jan 2014 03:16:53 +0000 (14:16 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 6 Jan 2014 09:08:16 +0000 (20:08 +1100)
commit362caa03f284f5115bccaa722e3663aa4fb1bde3
tree10b87a2395a6cee74f407418dd2fe08ddeaec81c
parent0a17f7d084ed58c2b432b435d8333c4c5a5d27c8
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>
drivers/w1/w1_int.c