Skip to content

Commit

Permalink
net/irda: add missing error path release_sock call
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kees authored and davem330 committed Mar 20, 2013
1 parent fa90b07 commit 896ee0e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/irda/af_irda.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 896ee0e

Please sign in to comment.