[PATCH] block cleanups: Fix iosched module refcount leak
[powerpc.git] / drivers / block / scsi_ioctl.c
index 079ec34..382dea7 100644 (file)
@@ -201,15 +201,15 @@ static int verify_command(struct file *file, unsigned char *cmd)
                        return 0;
        }
 
+       /* And root can do any command.. */
+       if (capable(CAP_SYS_RAWIO))
+               return 0;
+
        if (!type) {
                cmd_type[cmd[0]] = CMD_WARNED;
                printk(KERN_WARNING "scsi: unknown opcode 0x%02x\n", cmd[0]);
        }
 
-       /* And root can do any command.. */
-       if (capable(CAP_SYS_RAWIO))
-               return 0;
-
        /* Otherwise fail it with an "Operation not permitted" */
        return -EPERM;
 }