]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dcb: Add missing error check in dcb_ieee_set()
authorJohn Fastabend <john.r.fastabend@intel.com>
Tue, 21 Jun 2011 07:35:04 +0000 (07:35 +0000)
committerJoe Jin <joe.jin@oracle.com>
Wed, 16 May 2012 08:29:52 +0000 (16:29 +0800)
Missing error checking before nla_parse_nested().

Reported-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4003b65871c101eb5ce8f37a325feac54aa5c681)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
net/dcb/dcbnl.c

index 01607e7e58911b387ef1837fbc1d6d49134b8834..c6b2a3a2e31594fa5d6791e914bb6caad1ffb4ad 100644 (file)
@@ -1368,6 +1368,9 @@ static int dcbnl_ieee_set(struct net_device *netdev, struct nlattr **tb,
        if (!ops)
                return err;
 
+       if (!tb[DCB_ATTR_IEEE])
+               return -EINVAL;
+
        err = nla_parse_nested(ieee, DCB_ATTR_IEEE_MAX,
                               tb[DCB_ATTR_IEEE], dcbnl_ieee_policy);
        if (err)