The patch titled

     uml: error path cleanup

has been added to the -mm tree.  Its filename is

     uml-error-path-cleanup.patch

Patches currently in -mm which might be from [EMAIL PROTECTED] are

uml-remove-debugging-code-from-page-fault-path.patch
uml-rename-kconfig-files-to-be-like-the-other-arches.patch
ptrace-i386-fix-syscall-audit-interaction-with-singlestep.patch
uml-support-ptrace-adds-the-host-sysemu-support-for-uml-and-general-usage.patch
uml-support-reorganize-ptrace_sysemu-support.patch
uml-support-add-ptrace_sysemu_singlestep-option-to-i386.patch
sysemu-fix-sysaudit--singlestep-interaction.patch
uml-workaround-gdb-problems-on-debugging.patch
uml-fix-sigwinch-handler-race-while-waiting-for-signals.patch
uml-fault-handler-micro-cleanups.patch
uml-fix-signal-frame-copy_user.patch
uml-fix-a-macro-typo.patch
uml-error-path-cleanup.patch
uml-build-cleanup.patch
uml-remove-libc-reference-in-build.patch
uml-mark-smp-on-uml-x86_64-as-broken.patch
uml-remove-duplicated-exports.patch
uml-uml-i386-is-i386-when-running-on-x86_64.patch
uml-tlb-operation-batching.patch
uml-merge-duplicated-page-table-code.patch
um-fix-up-schedule_timeout-usage.patch



From: Jeff Dike <[EMAIL PROTECTED]>

This cleans up the error path in ubd_open, causing it now to call ubd_close
appropriately when something fails.

Signed-off-by: Jeff Dike <[EMAIL PROTECTED]>
Cc: Paolo Giarrusso <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 arch/um/drivers/ubd_kern.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff -puN arch/um/drivers/ubd_kern.c~uml-error-path-cleanup 
arch/um/drivers/ubd_kern.c
--- devel/arch/um/drivers/ubd_kern.c~uml-error-path-cleanup     2005-08-30 
00:11:09.000000000 -0700
+++ devel-akpm/arch/um/drivers/ubd_kern.c       2005-08-30 00:11:09.000000000 
-0700
@@ -668,21 +668,22 @@ static int ubd_add(int n)
        struct ubd *dev = &ubd_dev[n];
        int err;
 
+       err = -ENODEV;
        if(dev->file == NULL)
-               return(-ENODEV);
+               goto out;
 
        if (ubd_open_dev(dev))
-               return(-ENODEV);
+               goto out;
 
        err = ubd_file_size(dev, &dev->size);
        if(err < 0)
-               return(err);
+               goto out_close;
 
        dev->size = ROUND_BLOCK(dev->size);
 
        err = ubd_new_disk(MAJOR_NR, dev->size, n, &ubd_gendisk[n]);
        if(err) 
-               return(err);
+               goto out_close;
  
        if(fake_major != MAJOR_NR)
                ubd_new_disk(fake_major, dev->size, n, 
@@ -693,8 +694,11 @@ static int ubd_add(int n)
        if (fake_ide)
                make_ide_entries(ubd_gendisk[n]->disk_name);
 
+       err = 0;
+out_close:
        ubd_close(dev);
-       return 0;
+out:
+       return err;
 }
 
 static int ubd_config(char *str)
_
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to