Skip to content

Commit

Permalink
net: dcb: set error code on failures
Browse files Browse the repository at this point in the history
In function dcbnl_cee_fill(), returns the value of variable err on
errors. However, on some error paths (e.g. nla put fails), its value may
be 0. It may be better to explicitly set a negative errno to variable
err before returning.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188881

Signed-off-by: Pan Bian <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
SinkFinder authored and davem330 committed Dec 4, 2016
1 parent a38b610 commit c66ebf2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/dcb/dcbnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1353,6 +1353,7 @@ static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev)
dcb_unlock:
spin_unlock_bh(&dcb_lock);
nla_put_failure:
err = -EMSGSIZE;
return err;
}

Expand Down

0 comments on commit c66ebf2

Please sign in to comment.