]> git.hungrycats.org Git - linux/commitdiff
[PATCH] char/rio/rioctrl: fix ioctl return values
authorAndrew Morton <akpm@osdl.org>
Sat, 6 Mar 2004 16:49:11 +0000 (08:49 -0800)
committerJaroslav Kysela <perex@suse.cz>
Sat, 6 Mar 2004 16:49:11 +0000 (08:49 -0800)
From: "Randy.Dunlap" <rddunlap@osdl.org>

From: Tony Breeds <tony@bakeyournoodle.com>

It fixes 3 places where the ioctl returns positives instead of negatives.
I've gotten feedback from the maintainer (Rogier Wolff (sp?) and he has no
objections.

drivers/char/rio/rioctrl.c

index d2dda66fb34bddf3980491c2ec7473edfdf4efcb..7a74e2c872b79fcaf080bb76091295e48dc64491 100644 (file)
@@ -522,7 +522,7 @@ RIO_DEBUG_CTRL,                             if (su)
                                        else {
                                                rio_dprintk (RIO_DEBUG_CTRL, "p->RIOBindTab full! - Rta %x not added\n",
                                                        (int) arg);
-                                               return 1;
+                                               return -ENOMEM;
                                        }
                                        return 0;
                                }
@@ -1593,12 +1593,12 @@ RIO_DEBUG_CTRL,                                 if (su)
                        case RIO_NO_MESG:
                                if ( su )
                                         p->RIONoMessage = 1;
-                               return su ? 0 : EPERM;
+                               return su ? 0 : -EPERM;
 
                        case RIO_MESG:
                                if ( su )
                                        p->RIONoMessage = 0;
-                               return su ? 0 : EPERM;
+                               return su ? 0 : -EPERM;
 
                        case RIO_WHAT_MESG:
                                if ( copyout( (caddr_t)&p->RIONoMessage, (int)arg,