Module Name:    src
Committed By:   haad
Date:           Sun Jan  3 22:55:26 UTC 2010

Modified Files:
        src/sys/dev/dm: device-mapper.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/dm/device-mapper.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/dm/device-mapper.c
diff -u src/sys/dev/dm/device-mapper.c:1.13 src/sys/dev/dm/device-mapper.c:1.14
--- src/sys/dev/dm/device-mapper.c:1.13	Sun Jan  3 22:44:10 2010
+++ src/sys/dev/dm/device-mapper.c	Sun Jan  3 22:55:25 2010
@@ -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);
 	}
 

Reply via email to