Driver: spi: fix compiling err for rk3288
[firefly-linux-kernel-4.4.55.git] / mm / slub.c
index 41f7cae64a49bfef91d0f992df18fa4aae0cefb7..d6fe997c05778f8f66b2ef117c3d0d22618a4f39 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -5343,6 +5343,7 @@ static void memcg_propagate_slab_attrs(struct kmem_cache *s)
                char mbuf[64];
                char *buf;
                struct slab_attribute *attr = to_slab_attr(slab_attrs[i]);
+               ssize_t len;
 
                if (!attr || !attr->store || !attr->show)
                        continue;
@@ -5367,8 +5368,9 @@ static void memcg_propagate_slab_attrs(struct kmem_cache *s)
                        buf = buffer;
                }
 
-               attr->show(root_cache, buf);
-               attr->store(s, buf, strlen(buf));
+               len = attr->show(root_cache, buf);
+               if (len > 0)
+                       attr->store(s, buf, len);
        }
 
        if (buffer)