projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2e13f33
)
lightnvm: fix bad back free on error path
author
Javier González
<
[email protected]
>
Wed, 3 May 2017 09:19:05 +0000
(11:19 +0200)
committer
Jens Axboe
<
[email protected]
>
Thu, 4 May 2017 13:53:04 +0000
(07:53 -0600)
Free memory correctly when an allocation fails on a loop and we free
backwards previously successful allocations.
Signed-off-by: Javier González <
[email protected]
>
Reviewed-by: Matias Bjørling <
[email protected]
>
Reviewed-by: Christoph Hellwig <
[email protected]
>
Signed-off-by: Jens Axboe <
[email protected]
>
drivers/lightnvm/core.c
patch
|
blob
|
history
diff --git
a/drivers/lightnvm/core.c
b/drivers/lightnvm/core.c
index 54a06c3a2b8c7c1a31ed642eaf362013ebaa40cf..6a4aa608ad958a51a270b0cbdcaec0961facca82 100644
(file)
--- a/
drivers/lightnvm/core.c
+++ b/
drivers/lightnvm/core.c
@@
-74,7
+74,7
@@
static int nvm_reserve_luns(struct nvm_dev *dev, int lun_begin, int lun_end)
return 0;
err:
- while (--i > lun_begin)
+ while (--i >
=
lun_begin)
clear_bit(i, dev->lun_map);
return -EBUSY;
@@
-211,7
+211,7
@@
static struct nvm_tgt_dev *nvm_create_tgt_dev(struct nvm_dev *dev,
return tgt_dev;
err_ch:
- while (--i > 0)
+ while (--i >
=
0)
kfree(dev_map->chnls[i].lun_offs);
kfree(luns);
err_luns: