n_gsm: avoid accessing freed memory during CMD_FCOFF condition
authorRuss Gorby <russ.gorby@intel.com>
Mon, 13 Aug 2012 12:44:59 +0000 (13:44 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 17 Oct 2012 02:48:16 +0000 (03:48 +0100)
commit93ed2b137b974b6515f0c847438c7d78a567c1ce
treeab6586b097c16563425d4a0835f363fd5e80e986
parent083500a74cb59d5b3a3ccec5368ac850f41f3dcd
n_gsm: avoid accessing freed memory during CMD_FCOFF condition

commit b4338e1efc339986cf6c0a3652906e914a86e2d3 upstream.

gsm_data_kick was recently modified to allow messages on the
tx queue bound for DLCI0 to flow even during FCOFF conditions.
Unfortunately we introduced a bug discovered by code inspection
where subsequent list traversers can access freed memory if
the DLCI0 messages were not all at the head of the list.

Replaced singly linked tx list w/ a list_head and used
provided interfaces for traversing and deleting members.

Signed-off-by: Russ Gorby <russ.gorby@intel.com>
Tested-by: Yin, Fengwei <fengwei.yin@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/tty/n_gsm.c