From: YueHaibing Date: Tue, 19 Feb 2019 08:06:22 +0000 (+0800) Subject: net: rose: add missing dev_put() on error in rose_bind X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=3b9c9f3b0b0293a52c0edd033d9df3a6b0e06f62;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: David S. Miller --- 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; }