Commit ff58f7dd authored by Dan Carpenter's avatar Dan Carpenter Committed by Vinod Koul

dmaengine: idxd: off by one in cleanup code

The clean up is off by one so this will start at "i" and it should start
with "i - 1" and then it doesn't unregister the zeroeth elements in the
array.

Fixes: c52ca478 ("dmaengine: idxd: add configuration component of driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarDave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/X9nFeojulsNqUSnG@mwandaSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 26b614fa
...@@ -434,7 +434,7 @@ int idxd_register_driver(void) ...@@ -434,7 +434,7 @@ int idxd_register_driver(void)
return 0; return 0;
drv_fail: drv_fail:
for (; i > 0; i--) while (--i >= 0)
driver_unregister(&idxd_drvs[i]->drv); driver_unregister(&idxd_drvs[i]->drv);
return rc; return rc;
} }
...@@ -1840,7 +1840,7 @@ int idxd_register_bus_type(void) ...@@ -1840,7 +1840,7 @@ int idxd_register_bus_type(void)
return 0; return 0;
bus_err: bus_err:
for (; i > 0; i--) while (--i >= 0)
bus_unregister(idxd_bus_types[i]); bus_unregister(idxd_bus_types[i]);
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment