summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorBasil Gunn <basil@pacabunga.com>2017-01-14 21:18:55 +0100
committerDavid S. Miller <davem@davemloft.net>2017-01-16 20:39:58 +0100
commit8a367e74c0120ef68c8c70d5a025648c96626dff (patch)
treeb4a00d10c310c91f418947614021ed7a4db9c851 /net
parentbpf: rework prog_digest into prog_tag (diff)
downloadlinux-8a367e74c0120ef68c8c70d5a025648c96626dff.tar.xz
linux-8a367e74c0120ef68c8c70d5a025648c96626dff.zip
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: Basil Gunn <basil@pacabunga.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ax25/ax25_subr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ax25/ax25_subr.c b/net/ax25/ax25_subr.c
index 4855d18a8511..038b109b2be7 100644
--- a/net/ax25/ax25_subr.c
+++ b/net/ax25/ax25_subr.c
@@ -264,7 +264,7 @@ void ax25_disconnect(ax25_cb *ax25, int reason)
{
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_t1timer(ax25);
ax25_stop_t2timer(ax25);