]> 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>
Tue, 7 Apr 2015 23:57:08 +0000 (09:57 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 9 Apr 2015 09:07:13 +0000 (19:07 +1000)
commit228e87e9ea37c09d0e3a5505b9e8f76a4d72fd05
tree87e3fe47dc4efcf8cac34f2d11df84d4ba02f89c
parentde7dd16ca4783a1a086628dba6566027a32228b0
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