w1: don't leak refcount on slave attach failure in w1_attach_slave_device()

am: 1df66c4524

Change-Id: I60200dc28a2dd8d0349261225764a64e1991c789
This commit is contained in:
Maciej S. Szmigiero
2017-03-12 08:20:53 +00:00
committed by android-build-merger

View File

@@ -763,6 +763,7 @@ int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
dev_err(&dev->dev, "%s: Attaching %s failed.\n", __func__,
sl->name);
w1_family_put(sl->family);
atomic_dec(&sl->master->refcnt);
kfree(sl);
return err;
}