diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-02-19 16:06:22 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-02-19 13:22:46 -0800 |
commit | 3b9c9f3b0b0293a52c0edd033d9df3a6b0e06f62 (patch) | |
tree | 537857ad40f73eb0f8449d7923008d7a267902eb /net/rose | |
parent | a968b5e9d5879f9535d6099505f9e14abcafb623 (diff) | |
download | lwn-3b9c9f3b0b0293a52c0edd033d9df3a6b0e06f62.tar.gz lwn-3b9c9f3b0b0293a52c0edd033d9df3a6b0e06f62.zip |
net: rose: add missing dev_put() on error in rose_bind
when capable check failed, dev_put should
be call before return -EACCES.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rose')
-rw-r--r-- | net/rose/af_rose.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index d00a0ef39a56..c96f63ffe31e 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c @@ -689,8 +689,10 @@ static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) rose->source_call = user->call; ax25_uid_put(user); } else { - if (ax25_uid_policy && !capable(CAP_NET_BIND_SERVICE)) + if (ax25_uid_policy && !capable(CAP_NET_BIND_SERVICE)) { + dev_put(dev); return -EACCES; + } rose->source_call = *source; } |