From: Kees Cook Date: Wed, 20 Mar 2013 05:19:24 +0000 (+0000) Subject: net/irda: add missing error path release_sock call X-Git-Tag: v3.8.6~85 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3cdc03d8c552990fa4fbd5acfdfa44fe6d3a32a9;p=karo-tx-linux.git 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 Reported-by: Brad Spengler Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index b833677d83d6..4d04105a3f06 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;