Skip to contentSkip to conversation

fix interrupt flag bugs in irport.c (2.4.4-ac18)

PATCH New Rasmus Andersen 1 participant 1 message May 26, 2001 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix interrupt flag bugs in irport.c (2.4.4-ac18)

Hi.

The following patch tries to correct the interrupt bugs found by the stanford team a long time ago in drivers/net/irda/irport.c. Applies against 2.4.4-ac18.

drivers/net/irda/irport.c +19 -9
@@ -951,13 +951,17 @@
 	switch (cmd) {
 	case SIOCSBANDWIDTH: /* Set bandwidth */
 		if (!capable(CAP_NET_ADMIN))
-			return -EPERM;
-		irda_task_execute(self, __irport_change_speed, NULL, NULL, 
-				  (void *) irq->ifr_baudrate);
+			ret = -EPERM;
+                else
+			irda_task_execute(self, __irport_change_speed, NULL, 
+					  NULL, (void *) irq->ifr_baudrate);
 		break;
 	case SIOCSDONGLE: /* Set dongle */
-		if (!capable(CAP_NET_ADMIN))
-			return -EPERM;
+		if (!capable(CAP_NET_ADMIN)) {
+			ret = -EPERM;
+			break;
+		}
+
 		/* Initialize dongle */
 		dongle = irda_device_dongle_init(dev, irq->ifr_dongle);
 		if (!dongle)
@@ -978,16 +982,22 @@
 				  NULL);	
 		break;
 	case SIOCSMEDIABUSY: /* Set media busy */
-		if (!capable(CAP_NET_ADMIN))
-			return -EPERM;
+		if (!capable(CAP_NET_ADMIN)) {
+			ret = -EPERM;
+			break;
+		}
+
 		irda_device_set_media_busy(self->netdev, TRUE);
 		break;
 	case SIOCGRECEIVING: /* Check if we are receiving right now */
 		irq->ifr_receiving = irport_is_receiving(self);
 		break;
 	case SIOCSDTRRTS:
-		if (!capable(CAP_NET_ADMIN))
-			return -EPERM;
+		if (!capable(CAP_NET_ADMIN)) {
+			ret = -EPERM;
+			break;
+		}
+
 		irport_set_dtr_rts(dev, irq->ifr_dtr, irq->ifr_rts);
 		break;
 	default:
Signature · 5 lines
Regards,
        Rasmus([email protected])

A great many people think they are thinking when they are merely 
rearranging their prejudices. -- William James