Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sx: prepare for BKL pushdown

Wrap the ioctl handler, and in this case the break handler also in the
BKL. Remove bogus softcar handlers.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Alan Cox and committed by
Linus Torvalds
341339e7 f433c65b

+4 -13
+4 -13
drivers/char/sx.c
··· 1844 1844 int rv; 1845 1845 1846 1846 func_enter(); 1847 + lock_kernel(); 1847 1848 1848 1849 if (flag) 1849 1850 rv = sx_send_command(port, HS_START, -1, HS_IDLE_BREAK); ··· 1853 1852 if (rv != 1) 1854 1853 printk(KERN_ERR "sx: couldn't send break (%x).\n", 1855 1854 read_sx_byte(port->board, CHAN_OFFSET(port, hi_hstat))); 1856 - 1855 + unlock_kernel(); 1857 1856 func_exit(); 1858 1857 } 1859 1858 ··· 1889 1888 int rc; 1890 1889 struct sx_port *port = tty->driver_data; 1891 1890 void __user *argp = (void __user *)arg; 1892 - int ival; 1893 1891 1894 1892 /* func_enter2(); */ 1895 1893 1896 1894 rc = 0; 1895 + lock_kernel(); 1897 1896 switch (cmd) { 1898 - case TIOCGSOFTCAR: 1899 - rc = put_user(((tty->termios->c_cflag & CLOCAL) ? 1 : 0), 1900 - (unsigned __user *)argp); 1901 - break; 1902 - case TIOCSSOFTCAR: 1903 - if ((rc = get_user(ival, (unsigned __user *)argp)) == 0) { 1904 - tty->termios->c_cflag = 1905 - (tty->termios->c_cflag & ~CLOCAL) | 1906 - (ival ? CLOCAL : 0); 1907 - } 1908 - break; 1909 1897 case TIOCGSERIAL: 1910 1898 rc = gs_getserial(&port->gs, argp); 1911 1899 break; ··· 1905 1915 rc = -ENOIOCTLCMD; 1906 1916 break; 1907 1917 } 1918 + unlock_kernel(); 1908 1919 1909 1920 /* func_exit(); */ 1910 1921 return rc;