qcom: fg-memif: Return error properly when IMA read/write fails

In the SRAM masked write we read the register first, make
modification to the value and write it back. If the read fails
we bail out of the masked write function.

However there is a bug in the read api where the error code is
not properly returned. This causes the masked write to proceed
with a failed read and corruption ensues.

A similar bug is present in write api too where the error is not
returned correctly to the caller. Fix this.

Change-Id: Ic7651c5cb2e054a0b8b2dfe201463063ce9e167b
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
1 file changed