mac80211: fix possible null-pointer de-reference
commit9057874c22d14f2d6b335d8f5c19b1db06495a3f
authorChristian Lamparter <chunkeey@googlemail.com>
Fri, 8 Oct 2010 20:27:07 +0000 (8 22:27 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Dec 2010 21:32:08 +0000 (9 13:32 -0800)
tree7772e31b917a6af4721b7e5cbe6655221dd81a68
parent1edba29490abe9bd1c6fc8a08cd1f7a85732dd52
mac80211: fix possible null-pointer de-reference

commit d12c74528e3065c90df70fbc06ec6ffd6e804738 upstream.

This patch not only fixes a null-pointer de-reference
that would be triggered by a PLINK_OPEN frame with mis-
matching/incompatible mesh configuration, but also
responds correctly to non-compatible PLINK_OPEN frames
by generating a PLINK_CLOSE with the right reason code.

The original bug was detected by smatch.
( http://repo.or.cz/w/smatch.git )

net/mac80211/mesh_plink.c +574 mesh_rx_plink_frame(168)
error: we previously assumed 'sta' could be null.

Reviewed-and-Tested-by: Steve deRosier <steve@cozybit.com>
Reviewed-and-Tested-by: Javier Cardona <javier@cozybit.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/mac80211/mesh_plink.c