Commit 8a367e74 authored by Basil Gunn's avatar Basil Gunn Committed by David S. Miller

ax25: Fix segfault after sock connection timeout

The ax.25 socket connection timed out & the sock struct has been
previously taken down ie. sock struct is now a NULL pointer. Checking
the sock_flag causes the segfault.  Check if the socket struct pointer
is NULL before checking sock_flag. This segfault is seen in
timed out netrom connections.

Please submit to -stable.
Signed-off-by: default avatarBasil Gunn <basil@pacabunga.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f1f7714e
...@@ -264,7 +264,7 @@ void ax25_disconnect(ax25_cb *ax25, int reason) ...@@ -264,7 +264,7 @@ void ax25_disconnect(ax25_cb *ax25, int reason)
{ {
ax25_clear_queues(ax25); ax25_clear_queues(ax25);
if (!sock_flag(ax25->sk, SOCK_DESTROY)) if (!ax25->sk || !sock_flag(ax25->sk, SOCK_DESTROY))
ax25_stop_heartbeat(ax25); ax25_stop_heartbeat(ax25);
ax25_stop_t1timer(ax25); ax25_stop_t1timer(ax25);
ax25_stop_t2timer(ax25); ax25_stop_t2timer(ax25);
......
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