Commit 2185b4b7 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'thunderbolt-for-v6.11-rc3' of...

Merge tag 'thunderbolt-for-v6.11-rc3' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-linus

thunderbolt: Fixes for v6.11-rc3

This includes following USB4/Thunderbolt fixes for v6.11-rc3:

  - Fix memory leak in debugfs sideband register access
  - Fix hang when host router NVM is upgraded and there is another host
    connected.

Both have been in linux-next with no reported issues.

* tag 'thunderbolt-for-v6.11-rc3' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt:
  thunderbolt: Mark XDomain as unplugged when router is removed
  thunderbolt: Fix memory leaks in {port|retimer}_sb_regs_write()
parents 7c626ce4 e2006140
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -323,16 +323,17 @@ static ssize_t port_sb_regs_write(struct file *file, const char __user *user_buf

	if (mutex_lock_interruptible(&tb->lock)) {
		ret = -ERESTARTSYS;
		goto out_rpm_put;
		goto out;
	}

	ret = sb_regs_write(port, port_sb_regs, ARRAY_SIZE(port_sb_regs),
			    USB4_SB_TARGET_ROUTER, 0, buf, count, ppos);

	mutex_unlock(&tb->lock);
out_rpm_put:
out:
	pm_runtime_mark_last_busy(&sw->dev);
	pm_runtime_put_autosuspend(&sw->dev);
	free_page((unsigned long)buf);

	return ret < 0 ? ret : count;
}
@@ -355,16 +356,17 @@ static ssize_t retimer_sb_regs_write(struct file *file,

	if (mutex_lock_interruptible(&tb->lock)) {
		ret = -ERESTARTSYS;
		goto out_rpm_put;
		goto out;
	}

	ret = sb_regs_write(rt->port, retimer_sb_regs, ARRAY_SIZE(retimer_sb_regs),
			    USB4_SB_TARGET_RETIMER, rt->index, buf, count, ppos);

	mutex_unlock(&tb->lock);
out_rpm_put:
out:
	pm_runtime_mark_last_busy(&rt->dev);
	pm_runtime_put_autosuspend(&rt->dev);
	free_page((unsigned long)buf);

	return ret < 0 ? ret : count;
}
+1 −0
Original line number Diff line number Diff line
@@ -3392,6 +3392,7 @@ void tb_switch_remove(struct tb_switch *sw)
			tb_switch_remove(port->remote->sw);
			port->remote = NULL;
		} else if (port->xdomain) {
			port->xdomain->is_unplugged = true;
			tb_xdomain_remove(port->xdomain);
			port->xdomain = NULL;
		}