summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2013-03-20 06:19:24 +0100
committerDavid S. Miller <davem@davemloft.net>2013-03-20 17:23:13 +0100
commit896ee0eee6261e30c3623be931c3f621428947df (patch)
treedfd1a4415493362da42b7899a2e0aee51d220498
parentlpc_eth: fix error return code in lpc_eth_drv_probe() (diff)
downloadlinux-896ee0eee6261e30c3623be931c3f621428947df.tar.xz
linux-896ee0eee6261e30c3623be931c3f621428947df.zip
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;