Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/dm Refactor dmioctl to by cleaner and to copyout dic...



details:   https://anonhg.NetBSD.org/src/rev/6084bb01ba12
branches:  trunk
changeset: 750514:6084bb01ba12
user:      haad <haad%NetBSD.org@localhost>
date:      Sun Jan 03 22:55:25 2010 +0000

description:
Refactor dmioctl to by cleaner and to copyout dictionary in case when something
went wrong.

diffstat:

 sys/dev/dm/device-mapper.c |  16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diffs (34 lines):

diff -r 27f01cb6ee88 -r 6084bb01ba12 sys/dev/dm/device-mapper.c
--- a/sys/dev/dm/device-mapper.c        Sun Jan 03 22:44:10 2010 +0000
+++ b/sys/dev/dm/device-mapper.c        Sun Jan 03 22:55:25 2010 +0000
@@ -1,4 +1,4 @@
-/*        $NetBSD: device-mapper.c,v 1.13 2010/01/03 22:44:10 haad Exp $ */
+/*        $NetBSD: device-mapper.c,v 1.14 2010/01/03 22:55:25 haad Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -336,19 +336,15 @@
                if((r = prop_dictionary_copyin_ioctl(pref, cmd, &dm_dict_in)) != 0)
                        return r;
 
-               if ((r = dm_check_version(dm_dict_in)) != 0) {
-                           prop_object_release(dm_dict_in);
-                           return r;
-               }
+               if ((r = dm_check_version(dm_dict_in)) != 0)
+                       goto cleanup_exit;
 
                /* run ioctl routine */
-               if ((r = dm_cmd_to_fun(dm_dict_in)) != 0) {
-                       prop_object_release(dm_dict_in);
-                       return r;
-               }
+               if ((r = dm_cmd_to_fun(dm_dict_in)) != 0)
+                       goto cleanup_exit;
 
+cleanup_exit:
                r = prop_dictionary_copyout_ioctl(pref, cmd, dm_dict_in);
-
                prop_object_release(dm_dict_in);
        }
 



Home | Main Index | Thread Index | Old Index