Эх сурвалжийг харах

kobil_sct: Fix ioctls

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Alan Cox 17 жил өмнө
parent
commit
b31f658b0b

+ 4 - 2
drivers/usb/serial/kobil_sct.c

@@ -640,9 +640,11 @@ static void kobil_set_termios(struct tty_struct *tty,
 
 
 	priv = usb_get_serial_port_data(port);
 	priv = usb_get_serial_port_data(port);
 	if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
 	if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
-			priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID)
+			priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
 		/* This device doesn't support ioctl calls */
 		/* This device doesn't support ioctl calls */
+		*tty->termios = *old;
 		return;
 		return;
+	}
 
 
 	speed = tty_get_baud_rate(tty);
 	speed = tty_get_baud_rate(tty);
 	switch (speed) {
 	switch (speed) {
@@ -704,7 +706,7 @@ static int kobil_ioctl(struct tty_struct *tty, struct file *file,
 	if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
 	if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
 			priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID)
 			priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID)
 		/* This device doesn't support ioctl calls */
 		/* This device doesn't support ioctl calls */
-		return 0;
+		return -ENOIOCTLCMD;
 
 
 	switch (cmd) {
 	switch (cmd) {
 	case TCFLSH:
 	case TCFLSH: