X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fisdn%2Fact2000%2Fact2000_isa.c;h=df7923c5b843a33d4c4af95b9bf56335264837a2;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=e84aa5fb3449d72ff6e85f792b22ecb176005087;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c index e84aa5fb3..df7923c5b 100644 --- a/drivers/isdn/act2000/act2000_isa.c +++ b/drivers/isdn/act2000/act2000_isa.c @@ -18,13 +18,6 @@ static act2000_card *irq2card_map[16]; -static void -act2000_isa_delay(long t) -{ - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(t); -} - /* * Reset Controller, then try to read the Card's signature. + Return: @@ -419,7 +412,7 @@ act2000_isa_download(act2000_card * card, act2000_ddef __user * cb) if (!act2000_isa_reset(card->port)) return -ENXIO; - act2000_isa_delay(HZ / 2); + msleep_interruptible(500); if(copy_from_user(&cblock, cb, sizeof(cblock))) return -EFAULT; length = cblock.length; @@ -434,7 +427,10 @@ act2000_isa_download(act2000_card * card, act2000_ddef __user * cb) l = (length > 1024) ? 1024 : length; c = 0; b = buf; - copy_from_user(buf, p, l); + if (copy_from_user(buf, p, l)) { + kfree(buf); + return -EFAULT; + } while (c < l) { if (act2000_isa_writeb(card, *b++)) { printk(KERN_WARNING @@ -449,6 +445,6 @@ act2000_isa_download(act2000_card * card, act2000_ddef __user * cb) p += l; } kfree(buf); - act2000_isa_delay(HZ / 2); + msleep_interruptible(500); return (act2000_isa_getid(card)); }