Commit b39599b7cb8f295205b04827ff82e3afec687cde

Authored by Suman Anna
Committed by Ohad Ben-Cohen
1 parent f6161aa153

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, 15fc611 "remoteproc: convert to idr_alloc()".

Signed-off-by: Suman Anna <s-anna@ti.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

drivers/remoteproc/remoteproc_core.c
... ... @@ -217,7 +217,7 @@
217 217 * TODO: support predefined notifyids (via resource table)
218 218 */
219 219 ret = idr_alloc(&rproc->notifyids, rvring, 0, 0, GFP_KERNEL);
220   - if (ret) {
  220 + if (ret < 0) {
221 221 dev_err(dev, "idr_alloc failed: %d\n", ret);
222 222 dma_free_coherent(dev->parent, size, va, dma);
223 223 return ret;