Index: kernel/generic/src/sysinfo/sysinfo.c
===================================================================
--- kernel/generic/src/sysinfo/sysinfo.c	(revision aeb6f25d955b4d89927969b4bc4d20c34d515e89)
+++ kernel/generic/src/sysinfo/sysinfo.c	(revision b4ad39f0492e20598dfdf8e56be2993a517c41f7)
@@ -632,7 +632,5 @@
 /** Return sysinfo item determined by name from user space
  *
- * Should be called with interrupts disabled
- * and sysinfo_lock held. The path string passed from
- * the user space has to be properly null-terminated
+ * The path string passed from the user space has to be properly null-terminated
  * (the last passed character must be null).
  *
@@ -656,7 +654,15 @@
 	
 	if ((copy_from_uspace(path, ptr, size + 1) == 0)
-	    && (path[size] == 0))
+	    && (path[size] == 0)) {
+		/*
+		 * Prevent other functions from messing with sysinfo while we
+		 * are reading it.
+		 */
+		ipl_t ipl = interrupts_disable();
+		spinlock_lock(&sysinfo_lock);
 		ret = sysinfo_get_item(path, NULL, dry_run);
-	
+		spinlock_unlock(&sysinfo_lock);
+		interrupts_restore(ipl);
+	}
 	free(path);
 	return ret;
@@ -677,18 +683,16 @@
 unative_t sys_sysinfo_get_tag(void *path_ptr, size_t path_size)
 {
-	/* Avoid other functions to mess with sysinfo
-	   while we are reading it */
-	ipl_t ipl = interrupts_disable();
-	spinlock_lock(&sysinfo_lock);
-	
-	/* Get the item.
-	
-	   N.B.: There is no need to free any potential generated
-	   binary data since we request a dry run */
+	/*
+	 * Get the item.
+	 *
+	 * N.B.: There is no need to free any potential generated
+	 * binary data since we request a dry run.
+	 */
 	sysinfo_return_t ret = sysinfo_get_item_uspace(path_ptr, path_size, true);
 	
-	/* Map generated value types to constant types
-	   (user space does not care whether the
-	   value is constant or generated) */
+	/*
+	 * Map generated value types to constant types (user space does not care
+	 * whether the value is constant or generated).
+	 */
 	if (ret.tag == SYSINFO_VAL_FUNCTION_VAL)
 		ret.tag = SYSINFO_VAL_VAL;
@@ -696,7 +700,4 @@
 		ret.tag = SYSINFO_VAL_DATA;
 	
-	spinlock_unlock(&sysinfo_lock);
-	interrupts_restore(ipl);
-	
 	return (unative_t) ret.tag;
 }
@@ -719,19 +720,13 @@
     void *value_ptr)
 {
-	/* Avoid other functions to mess with sysinfo
-	   while we are reading it */
-	ipl_t ipl = interrupts_disable();
-	spinlock_lock(&sysinfo_lock);
-	
-	/* Get the item.
-	
-	   N.B.: There is no need to free any potential generated
-	   binary data since we request a dry run */
+	int rc;
+
+	/*
+	 * Get the item.
+	 *
+	 * N.B.: There is no need to free any potential generated binary data
+	 * since we request a dry run.
+	 */
 	sysinfo_return_t ret = sysinfo_get_item_uspace(path_ptr, path_size, true);
-
-	spinlock_unlock(&sysinfo_lock);
-	interrupts_restore(ipl);
-	
-	int rc;
 	
 	/* Only constant or generated numerical value is returned */
@@ -761,19 +756,13 @@
     void *size_ptr)
 {
-	/* Avoid other functions to mess with sysinfo
-	   while we are reading it */
-	ipl_t ipl = interrupts_disable();
-	spinlock_lock(&sysinfo_lock);
-	
-	/* Get the item.
-	
-	   N.B.: There is no need to free any potential generated
-	   binary data since we request a dry run */
+	int rc;
+	
+	/*
+	 * Get the item.
+	 *
+	 * N.B.: There is no need to free any potential generated binary data
+	 * since we request a dry run.
+	 */
 	sysinfo_return_t ret = sysinfo_get_item_uspace(path_ptr, path_size, true);
-
-	spinlock_unlock(&sysinfo_lock);
-	interrupts_restore(ipl);
-	
-	int rc;
 	
 	/* Only the size of constant or generated binary data is considered */
@@ -809,17 +798,9 @@
     void *buffer_ptr, size_t buffer_size)
 {
-	/* Avoid other functions to mess with sysinfo
-	   while we are reading it */
-	ipl_t ipl = interrupts_disable();
-	spinlock_lock(&sysinfo_lock);
+	int rc;
 	
 	/* Get the item */
 	sysinfo_return_t ret = sysinfo_get_item_uspace(path_ptr, path_size, false);
 
-	spinlock_unlock(&sysinfo_lock);
-	interrupts_restore(ipl);
-
-	int rc;
-	
 	/* Only constant or generated binary data is considered */
 	if ((ret.tag == SYSINFO_VAL_DATA) || (ret.tag == SYSINFO_VAL_FUNCTION_DATA)) {
