diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2020-12-16 11:29:46 +0300 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2020-12-29 10:07:59 +0530 |
commit | ff58f7dd0c1352a01de3a40327895bd51e03de3a (patch) | |
tree | 72ff2719bb2c7086b544e36d32ec8f11e6b591b1 /drivers | |
parent | 26b614fa441048a9f8e4a814c3b01756816ce7a7 (diff) |
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: c52ca478233c ("dmaengine: idxd: add configuration component of driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/X9nFeojulsNqUSnG@mwanda
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/idxd/sysfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c index 266423a2cabc..4dbb03c545e4 100644 --- a/drivers/dma/idxd/sysfs.c +++ b/drivers/dma/idxd/sysfs.c @@ -434,7 +434,7 @@ int idxd_register_driver(void) return 0; drv_fail: - for (; i > 0; i--) + while (--i >= 0) driver_unregister(&idxd_drvs[i]->drv); return rc; } @@ -1840,7 +1840,7 @@ int idxd_register_bus_type(void) return 0; bus_err: - for (; i > 0; i--) + while (--i >= 0) bus_unregister(idxd_bus_types[i]); return rc; } |