[PATCH] net/irda: add missing error path release_sock call

Subsystems: networking [general], the rest

STALE4935d

2 messages, 2 authors, 2013-03-20 · open the first message on its own page

[PATCH] net/irda: add missing error path release_sock call

From: Kees Cook <hidden>
Date: 2013-03-20 15:19:50

This makes sure that release_sock is called for all error conditions in
irda_getsockopt.

Signed-off-by: Kees Cook <redacted>
Reported-by: Brad Spengler <redacted>
Cc: stable@vger.kernel.org
---
 net/irda/af_irda.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index d07e3a6..d28e7f0 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;
-- 
1.7.9.5


-- 
Kees Cook
Chrome OS Security

Re: [PATCH] net/irda: add missing error path release_sock call

From: David Miller <davem@davemloft.net>
Date: 2013-03-20 16:23:40

From: Kees Cook <redacted>
Date: Wed, 20 Mar 2013 08:19:24 -0700
This makes sure that release_sock is called for all error conditions in
irda_getsockopt.

Signed-off-by: Kees Cook <redacted>
Reported-by: Brad Spengler <redacted>
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help