summaryrefslogtreecommitdiffstats
path: root/kernel/drivers/w1/w1_int.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/w1/w1_int.c')
-rw-r--r--kernel/drivers/w1/w1_int.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/drivers/w1/w1_int.c b/kernel/drivers/w1/w1_int.c
index 47249a30e..20f766afa 100644
--- a/kernel/drivers/w1/w1_int.c
+++ b/kernel/drivers/w1/w1_int.c
@@ -91,8 +91,7 @@ static struct w1_master *w1_alloc_dev(u32 id, int slave_count, int slave_ttl,
err = device_register(&dev->dev);
if (err) {
pr_err("Failed to register master device. err=%d\n", err);
- memset(dev, 0, sizeof(struct w1_master));
- kfree(dev);
+ put_device(&dev->dev);
dev = NULL;
}