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

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

r8152: check the status before submitting rx



Don't submit the rx if the device is unplugged, stopped, or
linking down.

Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aa2e0926
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1789,6 +1789,11 @@ int r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags)
{
	int ret;

	/* The rx would be stopped, so skip submitting */
	if (test_bit(RTL8152_UNPLUG, &tp->flags) ||
	    !test_bit(WORK_ENABLE, &tp->flags) || !netif_carrier_ok(tp->netdev))
		return 0;

	usb_fill_bulk_urb(agg->urb, tp->udev, usb_rcvbulkpipe(tp->udev, 1),
			  agg->head, agg_buf_sz,
			  (usb_complete_t)read_bulk_callback, agg);