Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[IRDA] donauboe: locking fix

From: Andrew Morton <akpm@osdl.org>

Two missing unlocks, as noted by Ted Unangst <tedu@coverity.com>

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Andrew Morton and committed by
David S. Miller
ac7c98ec b3f9b92a

+9 -5
+9 -5
drivers/net/irda/donauboe.c
··· 1459 1459 */ 1460 1460 IRDA_DEBUG (1, "%s(BANDWIDTH), %s, (%X/%ld\n", __FUNCTION__ 1461 1461 ,dev->name, INB (OBOE_STATUS), irq->ifr_baudrate ); 1462 - if (!in_interrupt () && !capable (CAP_NET_ADMIN)) 1463 - return -EPERM; 1462 + if (!in_interrupt () && !capable (CAP_NET_ADMIN)) { 1463 + ret = -EPERM; 1464 + goto out; 1465 + } 1464 1466 1465 1467 /* self->speed=irq->ifr_baudrate; */ 1466 1468 /* toshoboe_setbaud(self); */ ··· 1472 1470 case SIOCSMEDIABUSY: /* Set media busy */ 1473 1471 IRDA_DEBUG (1, "%s(MEDIABUSY), %s, (%X/%x)\n", __FUNCTION__ 1474 1472 ,dev->name, INB (OBOE_STATUS), capable (CAP_NET_ADMIN) ); 1475 - if (!capable (CAP_NET_ADMIN)) 1476 - return -EPERM; 1473 + if (!capable (CAP_NET_ADMIN)) { 1474 + ret = -EPERM; 1475 + goto out; 1476 + } 1477 1477 irda_device_set_media_busy (self->netdev, TRUE); 1478 1478 break; 1479 1479 case SIOCGRECEIVING: /* Check if we are receiving right now */ ··· 1487 1483 IRDA_DEBUG (1, "%s(?), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd); 1488 1484 ret = -EOPNOTSUPP; 1489 1485 } 1490 - 1486 + out: 1491 1487 spin_unlock_irqrestore(&self->spinlock, flags); 1492 1488 return ret; 1493 1489