Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc477ad3 authored by Peter Hurley's avatar Peter Hurley Committed by Johan Hovold
Browse files

USB: kobil_sct: Remove unused transfer buffer allocs



Commit 90419cfc,
"USB: kobil_sct: fix control requests without data stage", removed
the bogus data buffer arguments, but still allocate transfer
buffers which are not used.

Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent 012eee15
Loading
Loading
Loading
Loading
+0 −15
Original line number Original line Diff line number Diff line
@@ -414,8 +414,6 @@ static int kobil_tiocmset(struct tty_struct *tty,
	int result;
	int result;
	int dtr = 0;
	int dtr = 0;
	int rts = 0;
	int rts = 0;
	unsigned char *transfer_buffer;
	int transfer_buffer_length = 8;


	/* FIXME: locking ? */
	/* FIXME: locking ? */
	priv = usb_get_serial_port_data(port);
	priv = usb_get_serial_port_data(port);
@@ -425,11 +423,6 @@ static int kobil_tiocmset(struct tty_struct *tty,
		return -EINVAL;
		return -EINVAL;
	}
	}


	/* allocate memory for transfer buffer */
	transfer_buffer = kzalloc(transfer_buffer_length, GFP_KERNEL);
	if (!transfer_buffer)
		return -ENOMEM;

	if (set & TIOCM_RTS)
	if (set & TIOCM_RTS)
		rts = 1;
		rts = 1;
	if (set & TIOCM_DTR)
	if (set & TIOCM_DTR)
@@ -469,7 +462,6 @@ static int kobil_tiocmset(struct tty_struct *tty,
			KOBIL_TIMEOUT);
			KOBIL_TIMEOUT);
	}
	}
	dev_dbg(dev, "%s - Send set_status_line URB returns: %i\n", __func__, result);
	dev_dbg(dev, "%s - Send set_status_line URB returns: %i\n", __func__, result);
	kfree(transfer_buffer);
	return (result < 0) ? result : 0;
	return (result < 0) ? result : 0;
}
}


@@ -530,8 +522,6 @@ static int kobil_ioctl(struct tty_struct *tty,
{
{
	struct usb_serial_port *port = tty->driver_data;
	struct usb_serial_port *port = tty->driver_data;
	struct kobil_private *priv = usb_get_serial_port_data(port);
	struct kobil_private *priv = usb_get_serial_port_data(port);
	unsigned char *transfer_buffer;
	int transfer_buffer_length = 8;
	int result;
	int result;


	if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
	if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
@@ -541,10 +531,6 @@ static int kobil_ioctl(struct tty_struct *tty,


	switch (cmd) {
	switch (cmd) {
	case TCFLSH:
	case TCFLSH:
		transfer_buffer = kmalloc(transfer_buffer_length, GFP_KERNEL);
		if (!transfer_buffer)
			return -ENOBUFS;

		result = usb_control_msg(port->serial->dev,
		result = usb_control_msg(port->serial->dev,
			  usb_sndctrlpipe(port->serial->dev, 0),
			  usb_sndctrlpipe(port->serial->dev, 0),
			  SUSBCRequest_Misc,
			  SUSBCRequest_Misc,
@@ -559,7 +545,6 @@ static int kobil_ioctl(struct tty_struct *tty,
		dev_dbg(&port->dev,
		dev_dbg(&port->dev,
			"%s - Send reset_all_queues (FLUSH) URB returns: %i\n",
			"%s - Send reset_all_queues (FLUSH) URB returns: %i\n",
			__func__, result);
			__func__, result);
		kfree(transfer_buffer);
		return (result < 0) ? -EIO: 0;
		return (result < 0) ? -EIO: 0;
	default:
	default:
		return -ENOIOCTLCMD;
		return -ENOIOCTLCMD;