mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 23:23:53 +02:00
net/irda: add missing error path release_sock call
commit 896ee0eee6 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>
This commit is contained in:
parent
75e4839c59
commit
afc309756f
|
|
@ -2584,8 +2584,10 @@ static int irda_getsockopt(struct socket *sock, int level, int optname,
|
|||
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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user