w1: don't leak refcount on slave attach failure in w1_attach_slave_device()
am: 1df66c4524
Change-Id: I60200dc28a2dd8d0349261225764a64e1991c789
This commit is contained in:
commit
9bd63bea50
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue