summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2015-07-15 10:29:00 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-21 10:02:19 -0700
commit60aba92f05267a74c32bc2224dca2616abc44e50 (patch)
tree8b6ef1a75b1b2703800898479d941e7115ed2da5
parentaa997211a028c9f80b2db1e9d6a81da8408c674e (diff)
downloadlwn-60aba92f05267a74c32bc2224dca2616abc44e50.tar.gz
lwn-60aba92f05267a74c32bc2224dca2616abc44e50.zip
devres: fix devres_get()
commit 64526370d11ce8868ca495723d595b61e8697fbf upstream. Currently, devres_get() passes devres_free() the pointer to devres, but devres_free() should be given with the pointer to resource data. Fixes: 9ac7849e35f7 ("devres: device resource management") Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/base/devres.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/devres.c b/drivers/base/devres.c
index 545c4de412c3..cbe0b58bab3c 100644
--- a/drivers/base/devres.c
+++ b/drivers/base/devres.c
@@ -297,10 +297,10 @@ void * devres_get(struct device *dev, void *new_res,
if (!dr) {
add_dr(dev, &new_dr->node);
dr = new_dr;
- new_dr = NULL;
+ new_res = NULL;
}
spin_unlock_irqrestore(&dev->devres_lock, flags);
- devres_free(new_dr);
+ devres_free(new_res);
return dr->data;
}