diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2010-12-16 19:26:58 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-01-10 20:26:10 (GMT) |
commit | 7959d55679e4360205c9ebc89d40a5503c53bae2 (patch) | |
tree | b48d85556c24078d6c8dd623ce18bb8f920cbbb0 /drivers/staging/speakup/kobjects.c | |
parent | 7571f089d7522a95c103558faf313c7af8856ceb (diff) | |
download | linux-fsl-qoriq-7959d55679e4360205c9ebc89d40a5503c53bae2.tar.xz |
staging: speakup: fix failure handling
fix the failure handling in kobjects and the main function so that we
release the virtual keyboard if we exit due to another failure.
Signed-off-by: William Hubbs <w.d.hubbs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/speakup/kobjects.c')
-rw-r--r-- | drivers/staging/speakup/kobjects.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c index cc79f9e..408bb9b 100644 --- a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c @@ -984,8 +984,10 @@ int speakup_kobj_init(void) * not known ahead of time. */ accessibility_kobj = kobject_create_and_add("accessibility", NULL); - if (!accessibility_kobj) - return -ENOMEM; + if (!accessibility_kobj) { + retval = -ENOMEM; + goto out; + } speakup_kobj = kobject_create_and_add("speakup", accessibility_kobj); if (!speakup_kobj) { @@ -1002,7 +1004,7 @@ int speakup_kobj_init(void) if (retval) goto err_group; - return 0; + goto out; err_group: sysfs_remove_group(speakup_kobj, &main_attr_group); @@ -1010,6 +1012,7 @@ err_speakup: kobject_put(speakup_kobj); err_acc: kobject_put(accessibility_kobj); +out: return retval; } |