Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drbd: fix error return code in drbd_init()

Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Andreas Gruenbacher <agruen@linbit.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Wei Yongjun and committed by
Jens Axboe
6110d70b 26ea8f92

+1 -3
+1 -3
drivers/block/drbd/drbd_main.c
··· 2762 2762 /* 2763 2763 * allocate all necessary structs 2764 2764 */ 2765 - err = -ENOMEM; 2766 - 2767 2765 init_waitqueue_head(&drbd_pp_wait); 2768 2766 2769 2767 drbd_proc = NULL; /* play safe for drbd_cleanup */ ··· 2771 2773 if (err) 2772 2774 goto fail; 2773 2775 2776 + err = -ENOMEM; 2774 2777 drbd_proc = proc_create_data("drbd", S_IFREG | S_IRUGO , NULL, &drbd_proc_fops, NULL); 2775 2778 if (!drbd_proc) { 2776 2779 printk(KERN_ERR "drbd: unable to register proc file\n"); ··· 2802 2803 fail: 2803 2804 drbd_cleanup(); 2804 2805 if (err == -ENOMEM) 2805 - /* currently always the case */ 2806 2806 printk(KERN_ERR "drbd: ran out of memory\n"); 2807 2807 else 2808 2808 printk(KERN_ERR "drbd: initialization failure\n");