提交 64526370 编写于 作者: M Masahiro Yamada 提交者: Greg Kroah-Hartman

devres: fix devres_get()

Currently, devres_get() passes devres_free() the pointer to devres,
but devres_free() should be given with the pointer to resource data.

Fixes: 9ac7849e ("devres: device resource management")
Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: NTejun Heo <tj@kernel.org>
Cc: stable <stable@vger.kernel.org> # 2.6.21+
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 cbfe8fa6
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册