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:Jeffrey Hugo <jhugo@codeaurora.org> Signed-off-by:
Pratyush Anand <pratanan@codeaurora.org>
Loading
Please sign in to comment