]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
net/irda: add missing error path release_sock call
authorKees Cook <keescook@chromium.org>
Wed, 20 Mar 2013 05:19:24 +0000 (05:19 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Apr 2013 17:16:37 +0000 (10:16 -0700)
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/irda/af_irda.c

index cc616974a447d582a66c837a09c8c95b1fb8900a..8ad05f88b4539294e325bc71bb31c2ad3eb32a8f 100644 (file)
@@ -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;