public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: Jiang Liu <liuj97@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Nitin Gupta <ngupta@vflare.org>,
	Jerome Marchand <jmarchan@redhat.com>,
	Jiang Liu <jiang.liu@huawei.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v3 04/10] zram: avoid double free in function zram_bvec_write()
Date: Fri, 7 Jun 2013 17:06:22 +0900	[thread overview]
Message-ID: <20130607080622.GC22516@blaptop> (raw)
In-Reply-To: <1370534851-26056-5-git-send-email-jiang.liu@huawei.com>

On Fri, Jun 07, 2013 at 12:07:25AM +0800, Jiang Liu wrote:
> When doing a patial write and the whole page is filled with zero,
               ^
               partial

> zram_bvec_write() will free uncmem twice.
> 
> Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
> Acked-by: Minchan Kim <minchan@kernel.org>
> Cc: stable@vger.kernel.org
> ---
>  drivers/staging/zram/zram_drv.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
> index 2ca6dc9..27ab824 100644
> --- a/drivers/staging/zram/zram_drv.c
> +++ b/drivers/staging/zram/zram_drv.c
> @@ -272,8 +272,6 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>  
>  	if (page_zero_filled(uncmem)) {
>  		kunmap_atomic(user_mem);
> -		if (is_partial_io(bvec))
> -			kfree(uncmem);
>  		zram->stats.pages_zero++;
>  		zram_set_flag(meta, index, ZRAM_ZERO);
>  		ret = 0;
> -- 
> 1.8.1.2
> 
> --
> 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/

-- 
Kind regards,
Minchan Kim

  reply	other threads:[~2013-06-07  8:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1370534851-26056-1-git-send-email-jiang.liu@huawei.com>
2013-06-06 16:07 ` [PATCH v3 01/10] zram: avoid invalid memory access in zram_exit() Jiang Liu
2013-06-07  7:58   ` Minchan Kim
2013-06-07  9:29   ` Jerome Marchand
2013-06-06 16:07 ` [PATCH v3 02/10] zram: use zram->lock to protect zram_free_page() in swap free notify path Jiang Liu
2013-06-07  8:05   ` Minchan Kim
2013-06-07  9:32   ` Jerome Marchand
2013-06-06 16:07 ` [PATCH v3 03/10] zram: destroy all devices on error recovery path in zram_init() Jiang Liu
2013-06-06 16:07 ` [PATCH v3 04/10] zram: avoid double free in function zram_bvec_write() Jiang Liu
2013-06-07  8:06   ` Minchan Kim [this message]
2013-06-06 16:07 ` [PATCH v3 05/10] zram: avoid access beyond the zram device Jiang Liu
2013-06-07  8:09   ` Minchan Kim
2013-06-07  9:40     ` Jerome Marchand
2013-06-07  9:43       ` Jiang Liu
2013-06-06 16:07 ` [PATCH v3 06/10] zram: protect sysfs handler from invalid memory access Jiang Liu
2013-06-07  9:41   ` Jerome Marchand

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=20130607080622.GC22516@blaptop \
    --to=minchan@kernel.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jiang.liu@huawei.com \
    --cc=jmarchan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuj97@gmail.com \
    --cc=ngupta@vflare.org \
    --cc=stable@vger.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