Commit 394c2a52 authored by Jeffrey Hugo's avatar Jeffrey Hugo Committed by Pratyush Anand
Browse files

mhi_bus: dev: uci: Return error in open() if not enabled



If the device is not enabled, then an open() on that device should fail.
While the open() inplementation does treat the scenario as a failure,
it does not return an error code, since the code path relies on the
existing value of ret, which happens to be 0 due to eariler code.  This
means that the filesystem thinks everything is fine, and returns a valid
FD to userspace.  If userspace then invokes the poll() code path, the
driver assumes file->private_data is initialized, when it is not, causing
a crash.

Change-Id: I7288adbfa2cdd862fd18c17dbb9e3b6560bde979
Signed-off-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
Signed-off-by: default avatarPratyush Anand <pratanan@codeaurora.org>
parent c546c50a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment