Skip to contentSkip to conversation

airo.c set_bit bug

PATCH In review Jean Tourrilhes 2 participants 2 messages Jul 23, 2004 – Aug 3, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 airo.c set_bit bug

Hi Javier,

Managed to find a bug in the usage of set_bit/clear_bit in the
airo driver. I'm not sure if I caught all occurence of this pattern, and not sure about exact consequences of the bug, but we might as well fix it...

	Patch below...

	Have fun...

	Jean

--------------------------------------------------------

drivers/net/wireless/airo.c renamed from drivers/net/wireless/airo.j1.c +4 -2
@@ -1808,7 +1808,8 @@ static int writeConfigRid(struct airo_in
 	if (!test_bit (FLAG_COMMIT, &ai->flags))
 		return SUCCESS;
 
-	clear_bit (FLAG_COMMIT | FLAG_RESET, &ai->flags);
+	clear_bit (FLAG_COMMIT, &ai->flags);
+	clear_bit (FLAG_RESET, &ai->flags);
 	checkThrottle(ai);
 	cfgr = ai->config;
 
@@ -6158,7 +6159,8 @@ static int airo_set_txpow(struct net_dev
 	readCapabilityRid(local, &cap_rid);
 
 	if (vwrq->disabled) {
-		set_bit (FLAG_RADIO_OFF | FLAG_COMMIT, &local->flags);
+		set_bit (FLAG_RADIO_OFF, &local->flags);
+		set_bit (FLAG_COMMIT, &local->flags);
 		return -EINPROGRESS;		/* Call commit handler */
 	}
 	if (vwrq->flags != IW_TXPOW_MWATT) {
#1 lore raw

Thanks. Applied. I haven't found any other occurrence.

Javier Achirica

Quoted 37 lines · Jean Tourrilhes

Hi Javier,

Managed to find a bug in the usage of set_bit/clear_bit in the
airo driver. I'm not sure if I caught all occurence of this pattern, and not sure about exact consequences of the bug, but we might as well fix it...

	Patch below...

	Have fun...

	Jean

--------------------------------------------------------

drivers/net/wireless/airo.c renamed from drivers/net/wireless/airo.j1.c +4 -2
@@ -1808,7 +1808,8 @@ static int writeConfigRid(struct airo_in
 	if (!test_bit (FLAG_COMMIT, &ai->flags))
 		return SUCCESS;
 
-	clear_bit (FLAG_COMMIT | FLAG_RESET, &ai->flags);
+	clear_bit (FLAG_COMMIT, &ai->flags);
+	clear_bit (FLAG_RESET, &ai->flags);
 	checkThrottle(ai);
 	cfgr = ai->config;
 
@@ -6158,7 +6159,8 @@ static int airo_set_txpow(struct net_dev
 	readCapabilityRid(local, &cap_rid);
 
 	if (vwrq->disabled) {
-		set_bit (FLAG_RADIO_OFF | FLAG_COMMIT, &local->flags);
+		set_bit (FLAG_RADIO_OFF, &local->flags);
+		set_bit (FLAG_COMMIT, &local->flags);
 		return -EINPROGRESS;		/* Call commit handler */
 	}
 	if (vwrq->flags != IW_TXPOW_MWATT) {