Skip to content

Commit c66ebf2

Browse files
SinkFinderdavem330
authored andcommitted
net: dcb: set error code on failures
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 <bianpan2016@163.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a38b610 commit c66ebf2

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎net/dcb/dcbnl.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,6 +1353,7 @@ static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev)
13531353
dcb_unlock:
13541354
spin_unlock_bh(&dcb_lock);
13551355
nla_put_failure:
1356+
err = -EMSGSIZE;
13561357
return err;
13571358
}
13581359

0 commit comments

Comments
 (0)