Re: drivers/staging/zram/zram_drv.c:352:8-14: ERROR: reference preceded by free on line 343

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Sun, Oct 28, 2012 at 01:09:12AM +0800, Fengguang Wu wrote:
> Hi Nitin,
> 
> FYI, there are coccinelle warnings in
> 
> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux master
> head:   e657e078d3dfa9f96976db7a2b5fd7d7c9f1f1a6
> commit: c8f2f0db1d0294aaf37e8a85bea9bbc4aaf5c0fe staging: zram: Fix handling of incompressible pages
> date:   5 days ago
> 
> + drivers/staging/zram/zram_drv.c:352:8-14: ERROR: reference preceded by free on line 343

I'd like to cite some good comments from Julia:

: I'm not 100% sure whether this is a bug, because the various elements
: are under different conditionals, and I am not sure to understand the
: relationship between them.  But I think there is enough of a chance that
: there is a problem for it to be worth contacting the developer.
: 
: There is also a problem with the indentation of the kfree, which has too
: many tabs in front of it.

Thanks,
Fengguang

> vim +352 drivers/staging/zram/zram_drv.c
> 
> 306b0c95 drivers/staging/ramzswap/ramzswap_drv.c Nitin Gupta     2009-09-22  337  
> 924bd88d drivers/staging/zram/zram_drv.c         Jerome Marchand 2011-06-10  338  	ret = lzo1x_1_compress(uncmem, PAGE_SIZE, src, &clen,
> 8c921b2b drivers/staging/zram/zram_drv.c         Jerome Marchand 2011-06-10  339  			       zram->compress_workmem);
> 306b0c95 drivers/staging/ramzswap/ramzswap_drv.c Nitin Gupta     2009-09-22  340  
> ba82fe2e drivers/staging/zram/zram_drv.c         Cong Wang       2011-11-25  341  	kunmap_atomic(user_mem);
> 924bd88d drivers/staging/zram/zram_drv.c         Jerome Marchand 2011-06-10  342  	if (is_partial_io(bvec))
> 924bd88d drivers/staging/zram/zram_drv.c         Jerome Marchand 2011-06-10 @343  			kfree(uncmem);
> 306b0c95 drivers/staging/ramzswap/ramzswap_drv.c Nitin Gupta     2009-09-22  344  
> 8c921b2b drivers/staging/zram/zram_drv.c         Jerome Marchand 2011-06-10  345  	if (unlikely(ret != LZO_E_OK)) {
> 8c921b2b drivers/staging/zram/zram_drv.c         Jerome Marchand 2011-06-10  346  		pr_err("Compression failed! err=%d\n", ret);
> 924bd88d drivers/staging/zram/zram_drv.c         Jerome Marchand 2011-06-10  347  		goto out;
> 8c921b2b drivers/staging/zram/zram_drv.c         Jerome Marchand 2011-06-10  348  	}
> 306b0c95 drivers/staging/ramzswap/ramzswap_drv.c Nitin Gupta     2009-09-22  349  
> c8f2f0db drivers/staging/zram/zram_drv.c         Nitin Gupta     2012-10-10  350  	if (unlikely(clen > max_zpage_size)) {
> 130f315a drivers/staging/zram/zram_drv.c         Minchan Kim     2012-06-08  351  		zram_stat_inc(&zram->stats.bad_compress);
> c8f2f0db drivers/staging/zram/zram_drv.c         Nitin Gupta     2012-10-10 @352  		src = uncmem;
> c8f2f0db drivers/staging/zram/zram_drv.c         Nitin Gupta     2012-10-10  353  		clen = PAGE_SIZE;
> c8f2f0db drivers/staging/zram/zram_drv.c         Nitin Gupta     2012-10-10  354  	}
> a1dd52af drivers/staging/ramzswap/ramzswap_drv.c Nitin Gupta     2010-06-01  355  
> 
> ---
> 0-DAY kernel build testing backend         Open Source Technology Center
> Fengguang Wu, Yuanhan Liu                              Intel Corporation
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux