isdn/gigaset: fix non-heap pointer deallocation
authorTilman Schmidt <tilman@imap.cc>
Sat, 11 Oct 2014 11:46:30 +0000 (13:46 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Oct 2014 19:05:34 +0000 (15:05 -0400)
commitb8324f94202af7dc688576259803a2ef9a98d655
tree05043b6668f823104c3f5eb29451a3b4f0941efd
parent846ac30135e7c5e03b487c16c87ccb1ab020a01f
isdn/gigaset: fix non-heap pointer deallocation

at_state structures may be allocated individually or as part of a
cardstate or bc_state structure. The disconnect() function handled
both cases, creating a risk that it might try to deallocate an
at_state structure that had not been allocated individually.
Fix by splitting disconnect() into two variants handling cases
with and without an associated B channel separately, and adding
an explicit check.

Spotted with Coverity.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/isdn/gigaset/ev-layer.c