]> 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>
Thu, 9 Jan 2014 06:17:34 +0000 (17:17 +1100)
commit8b391f1836bebad34846539f8a5f3f80d447754b
treea1609240663e0b28ecec394e4c0a10fdbe56d4d6
parent443019d728be4e672af7ad965c74d8cefa8bda57
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