Commit 2c22dbb8 authored by Kees Cook's avatar Kees Cook Committed by Ben Hutchings

net/irda: add missing error path release_sock call

commit 896ee0ee upstream.

This makes sure that release_sock is called for all error conditions in
irda_getsockopt.
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Reported-by: default avatarBrad Spengler <spender@grsecurity.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 49b202a2
......@@ -2584,8 +2584,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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment