Commit 4003b65871c101eb5ce8f37a325feac54aa5c681

Authored by John Fastabend
Committed by David S. Miller
1 parent ab6baf980b

dcb: Add missing error check in dcb_ieee_set()

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>

Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff

... ... @@ -1368,6 +1368,9 @@
1368 1368 if (!ops)
1369 1369 return err;
1370 1370  
  1371 + if (!tb[DCB_ATTR_IEEE])
  1372 + return -EINVAL;
  1373 +
1371 1374 err = nla_parse_nested(ieee, DCB_ATTR_IEEE_MAX,
1372 1375 tb[DCB_ATTR_IEEE], dcbnl_ieee_policy);
1373 1376 if (err)