summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2013-03-20 09:19:24 +0400
committerDavid S. Miller <davem@davemloft.net>2013-03-20 20:23:13 +0400
commit896ee0eee6261e30c3623be931c3f621428947df (patch)
treedfd1a4415493362da42b7899a2e0aee51d220498
parentfa90b077d72b4ea92706e86fdff7b5dca294caa3 (diff)
downloadlinux-896ee0eee6261e30c3623be931c3f621428947df.tar.xz
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>
-rw-r--r--net/irda/af_irda.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index d07e3a626446..d28e7f014cc6 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -2583,8 +2583,10 @@ bed:
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;