Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1265111 > unrolled thread
| Started by | Geliang Tang <geliangtang@163.com> |
|---|---|
| First post | 2015-11-08 16:40 +0100 |
| Last post | 2015-11-09 01:50 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 2/2] zram: fix memory freeing in zram_bvec_read Geliang Tang <geliangtang@163.com> - 2015-11-08 16:40 +0100
Re: [PATCH 2/2] zram: fix memory freeing in zram_bvec_read Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-11-09 01:50 +0100
| From | Geliang Tang <geliangtang@163.com> |
|---|---|
| Date | 2015-11-08 16:40 +0100 |
| Subject | [PATCH 2/2] zram: fix memory freeing in zram_bvec_read |
| Message-ID | <qsAet-1UC-5@gated-at.bofh.it> |
When user_mem is NULL, there is no need to kunmap_atomic it.
Signed-off-by: Geliang Tang <geliangtang@163.com>
---
drivers/block/zram/zram_drv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 197a7ad..da7b348 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -625,7 +625,7 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,
if (!uncmem) {
pr_err("Unable to allocate temp memory\n");
ret = -ENOMEM;
- goto out_cleanup;
+ goto out_free;
}
ret = zram_decompress_page(zram, uncmem, index);
@@ -641,6 +641,7 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,
ret = 0;
out_cleanup:
kunmap_atomic(user_mem);
+out_free:
if (is_partial_io(bvec))
kfree(uncmem);
return ret;
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> |
|---|---|
| Date | 2015-11-09 01:50 +0100 |
| Message-ID | <qsIOK-7tX-19@gated-at.bofh.it> |
| In reply to | #1265111 |
On (11/08/15 23:32), Geliang Tang wrote:
> When user_mem is NULL, there is no need to kunmap_atomic it.
Hi,
kunmap_atomic() should be called.
-ss
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
> drivers/block/zram/zram_drv.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index 197a7ad..da7b348 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -625,7 +625,7 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,
> if (!uncmem) {
> pr_err("Unable to allocate temp memory\n");
> ret = -ENOMEM;
> - goto out_cleanup;
> + goto out_free;
> }
>
> ret = zram_decompress_page(zram, uncmem, index);
> @@ -641,6 +641,7 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,
> ret = 0;
> out_cleanup:
> kunmap_atomic(user_mem);
> +out_free:
> if (is_partial_io(bvec))
> kfree(uncmem);
> return ret;
> --
> 2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web