Change: e61734c55c24cdf11b07e52a74aec4dc4a7f4bd0.
Merged: dc5ed40686a4da95881c35d913b60f867755cbe2 in 3.15-rc1.

task_cgroup_name returns a pointer to the path or NULL if there is not
enough space in the buffer (used to return nonnegative or -ENAMETOOLONG).

On systemd systems fixes a kernel panic about init dying while opening a
bus. Now it boots properly.
---
 metadata.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/metadata.c b/metadata.c
index 5b47bb2..0620cce 100644
--- a/metadata.c
+++ b/metadata.c
@@ -335,18 +335,20 @@ static int kdbus_meta_append_caps(struct kdbus_meta *meta)
 #ifdef CONFIG_CGROUPS
 static int kdbus_meta_append_cgroup(struct kdbus_meta *meta)
 {
-       char *tmp;
-       int ret;
+       char *buf, *path;
+    int ret;
 
-       tmp = (char *)__get_free_page(GFP_TEMPORARY | __GFP_ZERO);
-       if (!tmp)
+       buf = (char *)__get_free_page(GFP_TEMPORARY | __GFP_ZERO);
+       if (!buf)
                return -ENOMEM;
 
-       ret = task_cgroup_path(current, tmp, PAGE_SIZE);
-       if (ret >= 0)
-               ret = kdbus_meta_append_str(meta, KDBUS_ITEM_CGROUP, tmp);
+       path = task_cgroup_path(current, buf, PAGE_SIZE);
+       if (path)
+               ret = kdbus_meta_append_str(meta, KDBUS_ITEM_CGROUP, path);
+    else
+        ret = -ENAMETOOLONG;
 
-       free_page((unsigned long) tmp);
+       free_page((unsigned long) buf);
 
        return ret;
 }
-- 
1.9.1

_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to