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

Commit d56dbe31 authored by Sujeev Dias's avatar Sujeev Dias
Browse files

mhi: devices: uci: release lock as last step



mhi_uci_release and mhi_uci_remove can get called in parallel and
protected by a mutex.  Both functions can release the same
resources, therefore all code execution must be inside the mutex
to avoid use after free errors.

CRs-Fixed: 2340364
Change-Id: I7786cab2897db2ec7ad1380e1920494627cbea73
Signed-off-by: default avatarSujeev Dias <sdias@codeaurora.org>
parent f6b03ace
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -191,10 +191,10 @@ static int mhi_uci_release(struct inode *inode, struct file *file)
		}
	}

	mutex_unlock(&uci_dev->mutex);

	MSG_LOG("exit: ref_count:%d\n", uci_dev->ref_count);

	mutex_unlock(&uci_dev->mutex);

	return 0;
}