Showing error 1258

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: drivers/char/vt_ioctl.c
Line in file: 399
Project: Linux Kernel
Project version: 2.6.28
Confirmation: Fixed by a115902f67ef51fbbe83e214fb761aaa9734c1ce
Tools: Stanse (1.2)
Entered: 2012-05-21 20:30:05 UTC


Source:

 369        struct vc_data *vc = (struct vc_data *)tty->driver_data;
 370        struct console_font_op op;        /* used in multiple places here */
 371        struct kbd_struct * kbd;
 372        unsigned int console;
 373        unsigned char ucval;
 374        void __user *up = (void __user *)arg;
 375        int i, perm;
 376        int ret = 0;
 377
 378        console = vc->vc_num;
 379
 380        lock_kernel();
 381
 382        if (!vc_cons_allocated(console)) {         /* impossible? */
 383                ret = -ENOIOCTLCMD;
 384                goto out;
 385        }
 386
 387
 388        /*
 389         * To have permissions to do most of the vt ioctls, we either have
 390         * to be the owner of the tty, or have CAP_SYS_TTY_CONFIG.
 391         */
 392        perm = 0;
 393        if (current->signal->tty == tty || capable(CAP_SYS_TTY_CONFIG))
 394                perm = 1;
 395 
 396        kbd = kbd_table + console;
 397        switch (cmd) {
 398        case TIOCLINUX:
 399                return tioclinux(tty, arg);
 400        case KIOCSOUND:
 401                if (!perm)
 402                        goto eperm;
 403                if (arg)
 404                        arg = CLOCK_TICK_RATE / arg;
 405                kd_mksound(arg, 0);
 406                break;
 407
 408        case KDMKTONE:
 409                if (!perm)
Show full sources