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

Commit ac0355c6 authored by Sreelakshmi Gownipalli's avatar Sreelakshmi Gownipalli Committed by Gerrit - the friendly Code Review server
Browse files

diag: Donot queue read in error case during mhi diag open



Donot queue any mhi diag read work when there is an error while
opening mhi diag channels.

Change-Id: Ie4a058b755dbdba7a3d12a19aebdc8f2e059e8ae
Signed-off-by: default avatarSreelakshmi Gownipalli <sgownipa@codeaurora.org>
parent 29444f60
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -320,6 +320,8 @@ static int __mhi_open(struct diag_mhi_info *mhi_info, int open_flag)

static int mhi_open(int id)
{
	int err = 0;

	if (id < 0 || id >= NUM_MHI_DEV) {
		pr_err("diag: In %s, invalid index %d\n", __func__, id);
		return -EINVAL;
@@ -330,7 +332,9 @@ static int mhi_open(int id)
	 * explicitly by Diag. Open both the read and write channels (denoted by
	 * OPEN_CHANNELS flag)
	 */
	__mhi_open(&diag_mhi[id], OPEN_CHANNELS);
	err = __mhi_open(&diag_mhi[id], OPEN_CHANNELS);
	if (err)
		return err;
	diag_remote_dev_open(diag_mhi[id].dev_id);
	queue_work(diag_mhi[id].mhi_wq, &(diag_mhi[id].read_work));