From: Rasmus Andersen <rasmus@jaquet.dk>
To: dag@brattli.net
Cc: linux-irda@pasta.cs.uit.no, linux-kernel@vger.kernel.org
Subject: [PATCH] fix interrupt flag bugs in irport.c (2.4.4-ac18)
Date: Sat, 26 May 2001 22:05:46 +0200 [thread overview]
Message-ID: <20010526220546.C857@jaquet.dk> (raw)
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.
--- linux-244-ac18-clean/drivers/net/irda/irport.c Sat May 19 20:59:17 2001
+++ linux-244-ac18/drivers/net/irda/irport.c Sat May 26 21:35:59 2001
@@ -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:
--
Regards,
Rasmus(rasmus@jaquet.dk)
A great many people think they are thinking when they are merely
rearranging their prejudices. -- William James
reply other threads:[~2001-05-26 20:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010526220546.C857@jaquet.dk \
--to=rasmus@jaquet.dk \
--cc=dag@brattli.net \
--cc=linux-irda@pasta.cs.uit.no \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox