1
0
Fork 0

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>
hifive-unleashed-5.1
YueHaibing 2019-02-19 16:06:22 +08:00 committed by David S. Miller
parent a968b5e9d5
commit 3b9c9f3b0b
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}