aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/um/drivers/ubd_kern.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 460d669b4774..eed95dc356e0 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -706,27 +706,36 @@ out:
706 706
707static int ubd_config(char *str) 707static int ubd_config(char *str)
708{ 708{
709 int n, err; 709 int n, ret;
710 710
711 str = kstrdup(str, GFP_KERNEL); 711 str = kstrdup(str, GFP_KERNEL);
712 if(str == NULL){ 712 if (str == NULL) {
713 printk(KERN_ERR "ubd_config failed to strdup string\n"); 713 printk(KERN_ERR "ubd_config failed to strdup string\n");
714 return(1); 714 ret = 1;
715 goto out;
715 } 716 }
716 err = ubd_setup_common(str, &n); 717 ret = ubd_setup_common(str, &n);
717 if(err){ 718 if (ret) {
718 kfree(str); 719 ret = -1;
719 return(-1); 720 goto err_free;
721 }
722 if (n == -1) {
723 ret = 0;
724 goto out;
720 } 725 }
721 if(n == -1) return(0);
722 726
723 mutex_lock(&ubd_lock); 727 mutex_lock(&ubd_lock);
724 err = ubd_add(n); 728 ret = ubd_add(n);
725 if(err) 729 if (ret)
726 ubd_devs[n].file = NULL; 730 ubd_devs[n].file = NULL;
727 mutex_unlock(&ubd_lock); 731 mutex_unlock(&ubd_lock);
728 732
729 return(err); 733out:
734 return ret;
735
736err_free:
737 kfree(str);
738 goto out;
730} 739}
731 740
732static int ubd_get_config(char *name, char *str, int size, char **error_out) 741static int ubd_get_config(char *name, char *str, int size, char **error_out)