lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 5 Feb 2015 09:20:19 +0900
From:	Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
	linux-kernel@...r.kernel.org, jmarchan@...hat.com,
	minchan@...nel.org, ngupta@...are.org, opensource.ganesh@...il.com,
	sergey.senozhatsky@...il.com, mm-commits@...r.kernel.org
Subject: Re: + zram-rework-reset-and-destroy-path-fix.patch added to -mm tree

Hello,
sorry for late response

On (02/04/15 14:29), Andrew Morton wrote:
> Seems unnecessarily complicated.  What about
> 
> --- a/drivers/block/zram/zram_drv.c~zram-rework-reset-and-destroy-path-fix-2-fix
> +++ a/drivers/block/zram/zram_drv.c
> @@ -1141,7 +1141,8 @@ static void destroy_devices(unsigned int
>  
>  static int __init zram_init(void)
>  {
> -	int ret = -ENOMEM, dev_id = 0;
> +	int ret;
> +	int dev_id;
>  
>  	if (num_devices > max_num_devices) {
>  		pr_warn("Invalid value for num_devices: %u\n",
> @@ -1157,20 +1158,23 @@ static int __init zram_init(void)
>  
>  	/* Allocate the device array and initialize each one */
>  	zram_devices = kzalloc(num_devices * sizeof(struct zram), GFP_KERNEL);
> -	if (!zram_devices)
> -		goto out_error;
> +	if (!zram_devices) {
> +		ret = -ENOMEM;

we need to rollback `zram_major = register_blkdev(0, "zram");'
which is done in destroy_devices().

	-ss
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ