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

Commit c5aebad8 authored by Yuanfang Zhang's avatar Yuanfang Zhang
Browse files

qdss_bridge: fix kfree issue



The "opened" state can be changed to ENABLE only if the
mhi_queue_inbound() call succeed in mhi_uci_open(). This ensures
that mhi_buf_tbl is initialized when the "opened" state is ENABLE.

Change-Id: I2749d15f3fc317cc6a874a14bc8a49bdc64a8a73
Signed-off-by: default avatarYuanfang Zhang <zhangyuanfang@codeaurora.org>
parent bfe405c9
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -773,13 +773,12 @@ static int mhi_uci_open(struct inode *inode, struct file *filp)
		spin_unlock_bh(&drvdata->lock);
		return ret;
	}
	drvdata->opened = ENABLE;
	spin_unlock_bh(&drvdata->lock);

	ret = mhi_prepare_for_transfer(drvdata->mhi_dev);
	if (ret) {
		pr_err("Error starting transfer channels\n");
		goto error_open_chan;
		return ret;
	}

	ret = mhi_queue_inbound(drvdata);
@@ -787,6 +786,7 @@ static int mhi_uci_open(struct inode *inode, struct file *filp)
		goto error_rx_queue;

	filp->private_data = drvdata;
	drvdata->opened = ENABLE;
	return ret;

error_rx_queue:
@@ -797,10 +797,6 @@ static int mhi_uci_open(struct inode *inode, struct file *filp)
		kfree(buf_itr);
	}

error_open_chan:
	spin_lock_bh(&drvdata->lock);
	drvdata->opened = DISABLE;
	spin_unlock_bh(&drvdata->lock);
	return ret;
}