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:	Wed, 04 Jun 2014 12:44:11 -0400
From:	Ewan Milne <emilne@...hat.com>
To:	Clément Calmels <clement.calmels@...e.fr>
Cc:	JBottomley@...allels.com, linux-scsi@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sd: bad return code of init_sd

On Tue, 2014-06-03 at 23:34 +0200, Clément Calmels wrote:
> In init_sd function, if kmem_cache_create or mempool_create_slab_pools
> calls fail, the error will not be correclty reported because
> class_register previously set the value of err to 0.
> 
> Signed-off-by: Clément Calmels <clement.calmels@...e.fr>
> ---
>  drivers/scsi/sd.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index e9689d5..7daa2aa 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -3205,12 +3205,14 @@ static int __init init_sd(void)
>  					 0, 0, NULL);
>  	if (!sd_cdb_cache) {
>  		printk(KERN_ERR "sd: can't init extended cdb cache\n");
> +		err = -ENOMEM;
>  		goto err_out_class;
>  	}
>  
>  	sd_cdb_pool = mempool_create_slab_pool(SD_MEMPOOL_SIZE, sd_cdb_cache);
>  	if (!sd_cdb_pool) {
>  		printk(KERN_ERR "sd: can't init extended cdb pool\n");
> +		err = -ENOMEM;
>  		goto err_out_cache;
>  	}
>  

I posted this same patch on 2/14/2013.  Thanks for reminding me!

Reviewed-by: Ewan D. Milne <emilne@...hat.com>


--
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