Skip to content

Commit

Permalink
mfd: core: Fix device reference leak in mfd_clone_cell
Browse files Browse the repository at this point in the history
Make sure to drop the reference taken by bus_find_device_by_name()
before returning from mfd_clone_cell().

Fixes: a9bbba9 ("mfd: add platform_device sharing support for mfd")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
  • Loading branch information
Johan Hovold authored and Lee Jones committed Nov 16, 2016
1 parent f405842 commit 722f191
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/mfd/mfd-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ int mfd_clone_cell(const char *cell, const char **clones, size_t n_clones)
clones[i]);
}

put_device(dev);

return 0;
}
EXPORT_SYMBOL(mfd_clone_cell);
Expand Down

0 comments on commit 722f191

Please sign in to comment.