[PATCH] bcm43xx: fix iwmode crash when down

This fixes a crash when

	iwconfig ethX mode foo

is done before

	ifconfig ethX up

or after

	ifconfig ethX down

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Michael Buesch 2006-05-01 22:43:00 +02:00 committed by John W. Linville
parent d57336e3f2
commit 5b4b9775a0

View file

@ -182,8 +182,11 @@ static int bcm43xx_wx_set_mode(struct net_device *net_dev,
mode = BCM43xx_INITIAL_IWMODE;
bcm43xx_lock_mmio(bcm, flags);
if (bcm->ieee->iw_mode != mode)
bcm43xx_set_iwmode(bcm, mode);
if (bcm->initialized) {
if (bcm->ieee->iw_mode != mode)
bcm43xx_set_iwmode(bcm, mode);
} else
bcm->ieee->iw_mode = mode;
bcm43xx_unlock_mmio(bcm, flags);
return 0;