]> 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, 24 Apr 2014 23:04:01 +0000 (09:04 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 28 Apr 2014 06:23:47 +0000 (16:23 +1000)
commit5640b7f7b375eab970bcb2c8b012e894a378f078
treeb77ecd23ecd750237c69ddac965cff966058b998
parent774733c02ecbc48f04fc4549182d51f526565fe9
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