--- zzzz-none-000/linux-3.10.107/drivers/tty/cyclades.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/tty/cyclades.c 2021-02-04 17:41:59.000000000 +0000 @@ -1577,15 +1577,6 @@ #endif /* - * If the port is the middle of closing, bail out now - */ - if (tty_hung_up_p(filp) || (info->port.flags & ASYNC_CLOSING)) { - wait_event_interruptible_tty(tty, info->port.close_wait, - !(info->port.flags & ASYNC_CLOSING)); - return (info->port.flags & ASYNC_HUP_NOTIFY) ? -EAGAIN: -ERESTARTSYS; - } - - /* * Start up serial port */ retval = cy_startup(info, tty); @@ -2709,6 +2700,8 @@ break; #ifndef CONFIG_CYZ_INTR case CYZSETPOLLCYCLE: + if (arg > LONG_MAX / HZ) + return -ENODEV; cyz_polling_cycle = (arg * HZ) / 1000; break; case CYZGETPOLLCYCLE: @@ -2859,9 +2852,7 @@ unsigned long flags; #ifdef CY_DEBUG_THROTTLE - char buf[64]; - - printk(KERN_DEBUG "cyc:throttle %s: %ld...ttyC%d\n", tty_name(tty, buf), + printk(KERN_DEBUG "cyc:throttle %s: %ld...ttyC%d\n", tty_name(tty), tty->ldisc.chars_in_buffer(tty), info->line); #endif @@ -2900,10 +2891,8 @@ unsigned long flags; #ifdef CY_DEBUG_THROTTLE - char buf[64]; - printk(KERN_DEBUG "cyc:unthrottle %s: %ld...ttyC%d\n", - tty_name(tty, buf), tty_chars_in_buffer(tty), info->line); + tty_name(tty), tty_chars_in_buffer(tty), info->line); #endif if (serial_paranoia_check(info, tty->name, "cy_unthrottle"))