Showing error 1791

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/char/tty_io.c
Line in file: 1661
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

1631                        if (waitqueue_active(&tty->write_wait)) {
1632                                wake_up(&tty->write_wait);
1633                                do_sleep++;
1634                        }
1635                }
1636                if (o_tty_closing) {
1637                        if (waitqueue_active(&o_tty->read_wait)) {
1638                                wake_up(&o_tty->read_wait);
1639                                do_sleep++;
1640                        }
1641                        if (waitqueue_active(&o_tty->write_wait)) {
1642                                wake_up(&o_tty->write_wait);
1643                                do_sleep++;
1644                        }
1645                }
1646                if (!do_sleep)
1647                        break;
1648
1649                printk(KERN_WARNING "tty_release_dev: %s: read/write wait queue "
1650                                    "active!\n", tty_name(tty, buf));
1651                mutex_unlock(&tty_mutex);
1652                schedule();
1653        }
1654
1655        /*
1656         * The closing flags are now consistent with the open counts on
1657         * both sides, and we've completed the last operation that could
1658         * block, so it's safe to proceed with closing.
1659         */
1660        if (pty_master) {
1661                if (--o_tty->count < 0) {
1662                        printk(KERN_WARNING "tty_release_dev: bad pty slave count "
1663                                            "(%d) for %s\n",
1664                               o_tty->count, tty_name(o_tty, buf));
1665                        o_tty->count = 0;
1666                }
1667        }
1668        if (--tty->count < 0) {
1669                printk(KERN_WARNING "tty_release_dev: bad tty->count (%d) for %s\n",
1670                       tty->count, tty_name(tty, buf));
1671                tty->count = 0;
Show full sources