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

Commit d582ec2c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "USB: gadget: serial: Fix debugfs crash"

parents 9f277664 5431ada4
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1273,6 +1273,9 @@ static ssize_t debug_read_status(struct file *file, char __user *ubuf,
	int ret;
	int result = 0;

	if (!ui_dev)
		return -EINVAL;

	tty = ui_dev->port.tty;
	gser = ui_dev->port_usb;

@@ -1325,6 +1328,9 @@ static ssize_t debug_write_reset(struct file *file, const char __user *buf,
	struct gs_port *ui_dev = file->private_data;
	unsigned long flags;

	if (!ui_dev)
		return -EINVAL;

	spin_lock_irqsave(&ui_dev->port_lock, flags);
	ui_dev->nbytes_from_host = ui_dev->nbytes_to_tty =
			ui_dev->nbytes_from_tty = ui_dev->nbytes_to_host = 0;
@@ -1354,6 +1360,9 @@ static void usb_debugfs_init(struct gs_port *ui_dev, int port_num)
{
	char buf[48];

	if (!ui_dev)
		return;

	snprintf(buf, 48, "usb_serial%d", port_num);
	gs_dent = debugfs_create_dir(buf, 0);
	if (!gs_dent || IS_ERR(gs_dent))