提交 b39599b7 编写于 作者: S Suman Anna 提交者: Ohad Ben-Cohen

remoteproc: fix the error check for idr_alloc

The new idr_alloc interface returns the allocated id back
on success, so fix the error path to check for negative
values. This was missed out in the newer idr interface
adoption patch, 15fc6110 "remoteproc: convert to idr_alloc()".
Signed-off-by: NSuman Anna <s-anna@ti.com>
Acked-by: NTejun Heo <tj@kernel.org>
Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
上级 f6161aa1
......@@ -217,7 +217,7 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
* TODO: support predefined notifyids (via resource table)
*/
ret = idr_alloc(&rproc->notifyids, rvring, 0, 0, GFP_KERNEL);
if (ret) {
if (ret < 0) {
dev_err(dev, "idr_alloc failed: %d\n", ret);
dma_free_coherent(dev->parent, size, va, dma);
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册