]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/netlink/attr.c
Merge branch 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[linux-2.6-omap-h63xx.git] / net / netlink / attr.c
index c83fea7da9a8246dce2b4fb137e357c395a83f9f..56c3ce7fe29af8b2bf47dd8bdc41edb93576c70a 100644 (file)
@@ -83,6 +83,12 @@ static int validate_nla(struct nlattr *nla, int maxtype,
                if (attrlen < NLA_ALIGN(pt->len) + NLA_HDRLEN + nla_len(nla))
                        return -ERANGE;
                break;
+       case NLA_NESTED:
+               /* a nested attributes is allowed to be empty; if its not,
+                * it must have a size of at least NLA_HDRLEN.
+                */
+               if (attrlen == 0)
+                       break;
        default:
                if (pt->len)
                        minlen = pt->len;