netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/irda: add missing error path release_sock call
@ 2013-03-20 15:19 Kees Cook
  2013-03-20 16:23 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Kees Cook @ 2013-03-20 15:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Samuel Ortiz, David S. Miller, netdev, Brad Spengler

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
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/irda: add missing error path release_sock call
  2013-03-20 15:19 [PATCH] net/irda: add missing error path release_sock call Kees Cook
@ 2013-03-20 16:23 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-03-20 16:23 UTC (permalink / raw)
  To: keescook; +Cc: linux-kernel, samuel, netdev, spender

From: Kees Cook <keescook@chromium.org>
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 <keescook@chromium.org>
> Reported-by: Brad Spengler <spender@grsecurity.net>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-20 16:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-20 15:19 [PATCH] net/irda: add missing error path release_sock call Kees Cook
2013-03-20 16:23 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).