]> 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>
Thu, 6 Mar 2014 00:05:19 +0000 (11:05 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 6 Mar 2014 07:13:29 +0000 (18:13 +1100)
commit4d470254092fd72047c5529793fcea75c1b817fa
tree2e6c4c778abd102d2135809b1581d60e990b0b38
parentc8e4101c841c6cd641cf6d96a481d23da0aa3bd4
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