Commit 8d964478 authored by Clément Calmels's avatar Clément Calmels Committed by Christoph Hellwig

sd: bad return code of init_sd

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: default avatarClément Calmels <clement.calmels@free.fr>
Reviewed-by: default avatarEwan D. Milne <emilne@redhat.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent cb2fb68d
...@@ -3212,12 +3212,14 @@ static int __init init_sd(void) ...@@ -3212,12 +3212,14 @@ static int __init init_sd(void)
0, 0, NULL); 0, 0, NULL);
if (!sd_cdb_cache) { if (!sd_cdb_cache) {
printk(KERN_ERR "sd: can't init extended cdb cache\n"); printk(KERN_ERR "sd: can't init extended cdb cache\n");
err = -ENOMEM;
goto err_out_class; goto err_out_class;
} }
sd_cdb_pool = mempool_create_slab_pool(SD_MEMPOOL_SIZE, sd_cdb_cache); sd_cdb_pool = mempool_create_slab_pool(SD_MEMPOOL_SIZE, sd_cdb_cache);
if (!sd_cdb_pool) { if (!sd_cdb_pool) {
printk(KERN_ERR "sd: can't init extended cdb pool\n"); printk(KERN_ERR "sd: can't init extended cdb pool\n");
err = -ENOMEM;
goto err_out_cache; goto err_out_cache;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment