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

Commit d0aa5369 authored by Vamsi Krishna's avatar Vamsi Krishna Committed by Hemant Kumar
Browse files

net: rmnet_usb_ctrl: Avoid double queuing of control buffers



Spurious notification on interrupt endpoint results in the
same get_encapsulated_response URB getting submitted/anchored
multiple times causing list double add bug. Avoid double queuing
of control URB by ignoring the get encapsulated request if control
URB is already in progress.

CRs-Fixed: 619652
Change-Id: I28924dd6b040529c0b5bf544d1185151afb669bb
Signed-off-by: default avatarVamsi Krishna <vskrishn@codeaurora.org>
parent 8e5d905c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ struct rmnet_ctrl_udev {
	unsigned int		tx_ctrl_err_cnt;
	unsigned int		zlp_cnt;
	unsigned int		invalid_mux_id_cnt;
	unsigned int		ignore_encap_work;
};

struct rmnet_ctrl_dev {
+8 −0
Original line number Diff line number Diff line
@@ -175,6 +175,11 @@ static void get_encap_work(struct work_struct *w)
	if (!test_bit(RMNET_CTRL_DEV_READY, &dev->status))
		return;

	if (dev->rcvurb->anchor) {
		dev->ignore_encap_work++;
		return;
	}

	udev = interface_to_usbdev(dev->intf);

	status = usb_autopm_get_interface(dev->intf);
@@ -981,6 +986,7 @@ static ssize_t rmnet_usb_ctrl_read_stats(struct file *file, char __user *ubuf,
					"mdm_wait_timeout:         %u\n"
					"zlp_cnt:                  %u\n"
					"get_encap_failure_cnt     %u\n"
					"ignore_encap_work         %u\n"
					"invalid mux id cnt        %u\n"
					"RMNET_CTRL_DEV_MUX_EN:    %d\n"
					"RMNET_CTRL_DEV_OPEN:      %d\n"
@@ -996,6 +1002,7 @@ static ssize_t rmnet_usb_ctrl_read_stats(struct file *file, char __user *ubuf,
					cdev->mdm_wait_timeout,
					dev->zlp_cnt,
					dev->get_encap_failure_cnt,
					dev->ignore_encap_work,
					dev->invalid_mux_id_cnt,
					test_bit(RMNET_CTRL_DEV_MUX_EN,
							&dev->status),
@@ -1030,6 +1037,7 @@ static ssize_t rmnet_usb_ctrl_reset_stats(struct file *file, const char __user *
			dev->tx_ctrl_err_cnt = 0;
			dev->zlp_cnt = 0;
			dev->invalid_mux_id_cnt = 0;
			dev->ignore_encap_work = 0;
		}
	}
	return count;