rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send()
[ Upstream commit5de775df33] The "ret" variable isn't initialized if we don't enter the loop. For example, if "channel->state" is not SMD_CHANNEL_OPENED. Fixes:33e3820dda("rpmsg: smd: Use spinlock in tx path") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/aAkhvV0nSbrsef1P@stanley.mountain Signed-off-by: Bjorn Andersson <andersson@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3b726bc126
commit
85322ddd44
@@ -746,7 +746,7 @@ static int __qcom_smd_send(struct qcom_smd_channel *channel, const void *data,
|
||||
__le32 hdr[5] = { cpu_to_le32(len), };
|
||||
int tlen = sizeof(hdr) + len;
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
/* Word aligned channels only accept word size aligned data */
|
||||
if (channel->info_word && len % 4)
|
||||
|
||||
Reference in New Issue
Block a user