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

Commit 8de91c80 authored by Jack Pham's avatar Jack Pham Committed by Gerrit - the friendly Code Review server
Browse files

usb: gadget: f_accessory: Fix check for dev->disconnected



The previous commit d378aeae512d ("usb: gadget: f_accessory: avoid
requeuing write req if disconnected") added a check for
dev->disconnected during write operation, but incorrectly
inverted the value, thus it fails when connected. Fix the polarity
of this check.

Change-Id: I447871d054e35a9d21eb9e55087facfbf7701dd5
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 25bd7a1b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -662,7 +662,7 @@ static ssize_t acc_write(struct file *fp, const char __user *buf,
		req = 0;
		ret = wait_event_interruptible(dev->write_wq,
			((req = req_get(dev, &dev->tx_idle)) || !dev->online));
		if (!dev->online || !dev->disconnected) {
		if (!dev->online || dev->disconnected) {
			pr_debug("acc_write dev->error\n");
			r = -EIO;
			break;