The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Geliang Tang <geliangtang@163.com>
Cc: Minchan Kim <minchan@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] zram: fix memory freeing in zram_bvec_read
Date: Mon, 9 Nov 2015 09:42:36 +0900	[thread overview]
Message-ID: <20151109004236.GB471@swordfish> (raw)
In-Reply-To: <71cc3c69c9d50cf63a808285f524c8b5210ffaf2.1446996521.git.geliangtang@163.com>

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


  reply	other threads:[~2015-11-09  0:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-08 15:32 [PATCH 1/2] zram: fix memory freeing in zram_meta_alloc Geliang Tang
2015-11-08 15:32 ` [PATCH 2/2] zram: fix memory freeing in zram_bvec_read Geliang Tang
2015-11-09  0:42   ` Sergey Senozhatsky [this message]
2015-11-09  0:33 ` [PATCH 1/2] zram: fix memory freeing in zram_meta_alloc Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151109004236.GB471@swordfish \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=geliangtang@163.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox