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: Kees Cook <keescook@chromium.org> Reported-by: Brad Spengler <spender@grsecurity.net> Cc: stable@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
fa90b077d7
commit
896ee0eee6
1 changed files with 4 additions and 2 deletions
|
@ -2583,8 +2583,10 @@ static int irda_getsockopt(struct socket *sock, int level, int optname,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
/* Check if the we got some results */
|
/* Check if the we got some results */
|
||||||
if (!self->cachedaddr)
|
if (!self->cachedaddr) {
|
||||||
return -EAGAIN; /* Didn't find any devices */
|
err = -EAGAIN; /* Didn't find any devices */
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
daddr = self->cachedaddr;
|
daddr = self->cachedaddr;
|
||||||
/* Cleanup */
|
/* Cleanup */
|
||||||
self->cachedaddr = 0;
|
self->cachedaddr = 0;
|
||||||
|
|
Loading…
Reference in a new issue