From: John Fastabend Date: Tue, 21 Jun 2011 07:35:04 +0000 (+0000) Subject: dcb: Add missing error check in dcb_ieee_set() X-Git-Tag: v2.6.39-400.9.0~423^2~19^2~11^2~613 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=87c733529e3bb66aabd7acf1cc77d727493a4711;p=users%2Fjedix%2Flinux-maple.git dcb: Add missing error check in dcb_ieee_set() Missing error checking before nla_parse_nested(). Reported-by: Mark Rustad Signed-off-by: John Fastabend Signed-off-by: David S. Miller (cherry picked from commit 4003b65871c101eb5ce8f37a325feac54aa5c681) Signed-off-by: Joe Jin --- diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index 01607e7e58911..c6b2a3a2e3159 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c @@ -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)