net:atm:fix up ENOIOCTLCMD error handling
authorWanlong Gao <gaowanlong@cn.fujitsu.com>
Sun, 26 Aug 2012 21:23:13 +0000 (21:23 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 31 Aug 2012 20:14:33 +0000 (16:14 -0400)
At commit 07d106d0, Linus pointed out that ENOIOCTLCMD should be
translated as ENOTTY to user mode.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/atm/resources.c

index 23f45ce6f3510fb1e9b30b58b7e52fac6a456961..0447d5d0b63983b139bda2853eaa9980640dd32d 100644 (file)
@@ -432,7 +432,7 @@ int atm_dev_ioctl(unsigned int cmd, void __user *arg, int compat)
                        size = dev->ops->ioctl(dev, cmd, buf);
                }
                if (size < 0) {
-                       error = (size == -ENOIOCTLCMD ? -EINVAL : size);
+                       error = (size == -ENOIOCTLCMD ? -ENOTTY : size);
                        goto done;
                }
        }