Commit d5c7c745 authored by Cong Wang's avatar Cong Wang Committed by David S. Miller

net/wan: fix a double free in x25_asy_open_tty()

When x25_asy_open() fails, it already cleans up by itself,
so its caller doesn't need to free the memory again.

It seems we still have to call x25_asy_free() to clear the SLF_INUSE
bit, so just set these pointers to NULL after kfree().

Fixes: 3b780bed ("x25_asy: Free x25_asy on x25_asy_open() failure.")
Signed-off-by: default avatarCong Wang <>
Signed-off-by: default avatarDavid S. Miller <>
parent c4335704
......@@ -485,8 +485,10 @@ static int x25_asy_open(struct net_device *dev)
/* Cleanup */
sl->xbuff = NULL;
sl->rbuff = NULL;
return -ENOMEM;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment