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

Commit 76c4427a authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

USB: ccid_bridge: Don't kill URB in release after device is disconnected



The URBs are killed in disconnect method. If the device is disconnected
before the /dev/ccid_bridge is closed, no need to kill the URBs again.
As the URB reference count is dropped in disconnect, accessing it in
release is causing the kernel panic.

CRs-Fixed: 653776
Change-Id: I7fae9ac2568cce59ea39bdd73c955d388d3f26bd
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent acf473c0
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -539,6 +539,14 @@ static int ccid_bridge_release(struct inode *ip, struct file *fp)

	pr_debug("called");

	mutex_lock(&ccid->open_mutex);
	if (ccid->intf == NULL) {
		ccid->opened = false;
		mutex_unlock(&ccid->open_mutex);
		goto done;
	}
	mutex_unlock(&ccid->open_mutex);

	usb_kill_urb(ccid->writeurb);
	usb_kill_urb(ccid->readurb);
	if (ccid->int_pipe)
@@ -550,6 +558,7 @@ static int ccid_bridge_release(struct inode *ip, struct file *fp)
	mutex_lock(&ccid->open_mutex);
	ccid->opened = false;
	mutex_unlock(&ccid->open_mutex);
done:
	return 0;
}