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

Commit 0f8390bb authored by Sujeev Dias's avatar Sujeev Dias Committed by Gerrit - the friendly Code Review server
Browse files

mhi: dev: uci: fix incorrect return code during open failure



UCI open was returning success when channel was in disable
state. This change return the correct error code.

CRs-Fixed: 2356399
Change-Id: I0f7919324d560ba28a91b17ff2be0b644481d75b
Signed-off-by: default avatarSujeev Dias <sdias@codeaurora.org>
parent ade232c6
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -429,21 +429,21 @@ static ssize_t mhi_uci_read(struct file *file,

static int mhi_uci_open(struct inode *inode, struct file *filp)
{
	struct uci_dev *uci_dev;
	struct uci_dev *uci_dev = NULL, *tmp_dev;
	int ret = -EIO;
	struct uci_buf *buf_itr, *tmp;
	struct uci_chan *dl_chan;

	mutex_lock(&mhi_uci_drv.lock);
	list_for_each_entry(uci_dev, &mhi_uci_drv.head, node) {
		if (uci_dev->devt == inode->i_rdev) {
			ret = 0;
	list_for_each_entry(tmp_dev, &mhi_uci_drv.head, node) {
		if (tmp_dev->devt == inode->i_rdev) {
			uci_dev = tmp_dev;
			break;
		}
	}

	/* could not find a minor node */
	if (ret)
	if (!uci_dev)
		goto error_exit;

	mutex_lock(&uci_dev->mutex);