mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
w1: don't leak refcount on slave attach failure in w1_attach_slave_device()
am: 1df66c4524
Change-Id: I60200dc28a2dd8d0349261225764a64e1991c789
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user