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:
a96d50f
)
lightnvm: pblk: fix error path in pblk_lines_alloc_metadata
author
Rakesh Pandit
<
[email protected]
>
Fri, 13 Oct 2017 12:45:54 +0000
(14:45 +0200)
committer
Jens Axboe
<
[email protected]
>
Fri, 13 Oct 2017 14:34:57 +0000
(08:34 -0600)
Use appropriate memory free calls based on allocation type used and
also fix number of times free is called if kmalloc fails.
Signed-off-by: Rakesh Pandit <
[email protected]
>
Reviewed-by: Javier González <
[email protected]
>
Signed-off-by: Matias Bjørling <
[email protected]
>
Signed-off-by: Jens Axboe <
[email protected]
>
drivers/lightnvm/pblk-init.c
patch
|
blob
|
history
diff --git
a/drivers/lightnvm/pblk-init.c
b/drivers/lightnvm/pblk-init.c
index 6df65d14a2c52c42a70690ad72da776e65885a8f..05665a7e648ca6edaf4a30be88de383a3fd6938c 100644
(file)
--- a/
drivers/lightnvm/pblk-init.c
+++ b/
drivers/lightnvm/pblk-init.c
@@
-630,7
+630,10
@@
static int pblk_lines_alloc_metadata(struct pblk *pblk)
fail_free_emeta:
while (--i >= 0) {
- vfree(l_mg->eline_meta[i]->buf);
+ if (l_mg->emeta_alloc_type == PBLK_VMALLOC_META)
+ vfree(l_mg->eline_meta[i]->buf);
+ else
+ kfree(l_mg->eline_meta[i]->buf);
kfree(l_mg->eline_meta[i]);
}