make xattr_resolve_handlers() safe to use with NULL ->s_xattr
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 25 May 2016 21:34:41 +0000 (17:34 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 25 May 2016 21:34:41 +0000 (17:34 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/xattr.c

index 4231488f2122e9dc33f4059071a13ebca152ea99..fc81e771488a670ebeac9606cc815dab1ded6446 100644 (file)
@@ -655,6 +655,7 @@ strcmp_prefix(const char *a, const char *a_prefix)
  * operations to the correct xattr_handler.
  */
 #define for_each_xattr_handler(handlers, handler)              \
+       if (handlers)                                           \
                for ((handler) = *(handlers)++;                 \
                        (handler) != NULL;                      \
                        (handler) = *(handlers)++)