summaryrefslogtreecommitdiff
path: root/net/irda/af_irda.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2013-03-20 09:19:24 +0400
committerBen Hutchings <ben@decadent.org.uk>2013-04-10 06:20:00 +0400
commit2c22dbb8ad3e320dfd1d98ba687b4966bcb65502 (patch)
tree80773d55d76883222442560ee0db5f7372418bd8 /net/irda/af_irda.c
parent49b202a2e31cd792c127c9a306947e101f7300d9 (diff)
downloadlinux-2c22dbb8ad3e320dfd1d98ba687b4966bcb65502.tar.xz
net/irda: add missing error path release_sock call
commit 896ee0eee6261e30c3623be931c3f621428947df upstream. 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> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net/irda/af_irda.c')
-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 c24f25ab67d3..f4b49c5b5642 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -2584,8 +2584,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;