Commit ea3336ac authored by Prameela Rani Garnepudi's avatar Prameela Rani Garnepudi Committed by Kalle Valo

rsi: Handle usb multi-byte write failure case properly

In function usb_write_register_multiple, if any intermediate block transfer
is failed, further operations should be terminated. 'else' is removed, as
there is no significance for it after return.
Signed-off-by: default avatarPrameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: default avatarAmitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 4b1fc881
...@@ -316,12 +316,13 @@ int rsi_usb_write_register_multiple(struct rsi_hw *adapter, ...@@ -316,12 +316,13 @@ int rsi_usb_write_register_multiple(struct rsi_hw *adapter,
rsi_dbg(ERR_ZONE, rsi_dbg(ERR_ZONE,
"Reg write failed with error code :%d\n", "Reg write failed with error code :%d\n",
status); status);
} else { kfree(buf);
return status;
}
count -= transfer; count -= transfer;
data += transfer; data += transfer;
addr += transfer; addr += transfer;
} }
}
kfree(buf); kfree(buf);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment