提交 896ee0ee 编写于 作者: K Kees Cook 提交者: David S. Miller

net/irda: add missing error path release_sock call

This makes sure that release_sock is called for all error conditions in
irda_getsockopt.
Signed-off-by: NKees Cook <keescook@chromium.org>
Reported-by: NBrad Spengler <spender@grsecurity.net>
Cc: stable@vger.kernel.org
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 fa90b077
......@@ -2583,8 +2583,10 @@ static int irda_getsockopt(struct socket *sock, int level, int optname,
NULL, NULL, NULL);
/* Check if the we got some results */
if (!self->cachedaddr)
return -EAGAIN; /* Didn't find any devices */
if (!self->cachedaddr) {
err = -EAGAIN; /* Didn't find any devices */
goto out;
}
daddr = self->cachedaddr;
/* Cleanup */
self->cachedaddr = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册