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

Commit f4c7476b authored by hayeswang's avatar hayeswang Committed by David S. Miller
Browse files

r8152: reset tp->speed before autoresuming in open function



If (tp->speed & LINK_STATUS) is not zero, the rtl8152_resume()
would call rtl_start_rx() before enabling the tx/rx. Avoid this
by resetting it to zero.

Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 923e1ee3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2891,6 +2891,9 @@ static int rtl8152_open(struct net_device *netdev)
	if (res)
		goto out;

	/* set speed to 0 to avoid autoresume try to submit rx */
	tp->speed = 0;

	res = usb_autopm_get_interface(tp->intf);
	if (res < 0) {
		free_all_mem(tp);
@@ -2904,6 +2907,8 @@ static int rtl8152_open(struct net_device *netdev)
		clear_bit(WORK_ENABLE, &tp->flags);
		usb_kill_urb(tp->intr_urb);
		cancel_delayed_work_sync(&tp->schedule);

		/* disable the tx/rx, if the workqueue has enabled them. */
		if (tp->speed & LINK_STATUS)
			tp->rtl_ops.disable(tp);
	}