summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-02-15 04:13:40 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-02-15 04:13:40 +0400
commitad07f124ae2df2c9c842b33c53d451a121639087 (patch)
tree2af75eb333d5921b4ee2013daa2bf3da799292b8 /drivers
parentbb0a05d7560084091032504ec3a574a00a110e52 (diff)
parent9e1ccb4a7700fcb3ddfe2767e0bbb6131f8ab54e (diff)
downloadlinux-ad07f124ae2df2c9c842b33c53d451a121639087.tar.xz
Merge tag 'driver-core-3.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core fix from Greg KH: "Here is a single driver core patch for 3.14-rc3 for the component code that Russell has found and fixed" * tag 'driver-core-3.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: drivers/base: fix devres handling for master device
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/component.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/base/component.c b/drivers/base/component.c
index c53efe6c6d8e..c4778995cd72 100644
--- a/drivers/base/component.c
+++ b/drivers/base/component.c
@@ -133,9 +133,16 @@ static int try_to_bring_up_master(struct master *master,
goto out;
}
+ if (!devres_open_group(master->dev, NULL, GFP_KERNEL)) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
/* Found all components */
ret = master->ops->bind(master->dev);
if (ret < 0) {
+ devres_release_group(master->dev, NULL);
+ dev_info(master->dev, "master bind failed: %d\n", ret);
master_remove_components(master);
goto out;
}
@@ -166,6 +173,7 @@ static void take_down_master(struct master *master)
{
if (master->bound) {
master->ops->unbind(master->dev);
+ devres_release_group(master->dev, NULL);
master->bound = false;
}