From b658322f894f61badaebd33adeb7720968cd58e3 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 13 Apr 2003 20:22:36 -0700 Subject: [PATCH] [PATCH] USB: kobil_sct fix up errors found by smatch --- drivers/usb/serial/kobil_sct.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index e15f060772f4a..375fd3eef788c 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c @@ -514,7 +514,9 @@ static int kobil_ioctl(struct usb_serial_port *port, struct file *file, dbg("%s - port %d Error in verify_area", __FUNCTION__, port->number); return(result); } - kernel_termios_to_user_termios((struct termios *)arg, &priv->internal_termios); + if (kernel_termios_to_user_termios((struct termios *)arg, + &priv->internal_termios)) + return -EFAULT; return 0; case TCSETS: // 0x5402 @@ -527,7 +529,9 @@ static int kobil_ioctl(struct usb_serial_port *port, struct file *file, dbg("%s - port %d Error in verify_area", __FUNCTION__, port->number); return result; } - user_termios_to_kernel_termios( &priv->internal_termios, (struct termios *)arg); + if (user_termios_to_kernel_termios(&priv->internal_termios, + (struct termios *)arg)) + return -EFAULT; settings = (unsigned char *) kmalloc(50, GFP_KERNEL); if (! settings) { -- 2.53.0