From ac7c98eca88a854755475fcfe1b2bf5f97f90d99 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 8 Nov 2005 09:41:13 -0800 Subject: [PATCH] [IRDA] donauboe: locking fix From: Andrew Morton Two missing unlocks, as noted by Ted Unangst Signed-off-by: Andrew Morton Signed-off-by: David S. Miller --- drivers/net/irda/donauboe.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c index 0282771b1cbb..3137592d60c0 100644 --- a/drivers/net/irda/donauboe.c +++ b/drivers/net/irda/donauboe.c @@ -1459,8 +1459,10 @@ toshoboe_net_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) */ IRDA_DEBUG (1, "%s(BANDWIDTH), %s, (%X/%ld\n", __FUNCTION__ ,dev->name, INB (OBOE_STATUS), irq->ifr_baudrate ); - if (!in_interrupt () && !capable (CAP_NET_ADMIN)) - return -EPERM; + if (!in_interrupt () && !capable (CAP_NET_ADMIN)) { + ret = -EPERM; + goto out; + } /* self->speed=irq->ifr_baudrate; */ /* toshoboe_setbaud(self); */ @@ -1470,8 +1472,10 @@ toshoboe_net_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) case SIOCSMEDIABUSY: /* Set media busy */ IRDA_DEBUG (1, "%s(MEDIABUSY), %s, (%X/%x)\n", __FUNCTION__ ,dev->name, INB (OBOE_STATUS), capable (CAP_NET_ADMIN) ); - if (!capable (CAP_NET_ADMIN)) - return -EPERM; + if (!capable (CAP_NET_ADMIN)) { + ret = -EPERM; + goto out; + } irda_device_set_media_busy (self->netdev, TRUE); break; case SIOCGRECEIVING: /* Check if we are receiving right now */ @@ -1483,7 +1487,7 @@ toshoboe_net_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) IRDA_DEBUG (1, "%s(?), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd); ret = -EOPNOTSUPP; } - +out: spin_unlock_irqrestore(&self->spinlock, flags); return ret; -- 2.20.1