summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2016-12-03 14:49:08 +0100
committerDavid S. Miller <davem@davemloft.net>2016-12-04 05:54:25 +0100
commitc66ebf2db555c6ed705044eabd2b37dcd546f68b (patch)
treebcc603ed251cdf86642b9441b4658fa93f4d9b50
parentMerge tag 'batadv-net-for-davem-20161202' of git://git.open-mesh.org/linux-merge (diff)
downloadlinux-c66ebf2db555c6ed705044eabd2b37dcd546f68b.tar.xz
linux-c66ebf2db555c6ed705044eabd2b37dcd546f68b.zip
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>
-rw-r--r--net/dcb/dcbnl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 4f6c1862dfd2..3202d75329b5 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -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;
}