mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send()
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>
This commit is contained in:
parent
75499b3232
commit
5de775df33
|
@ -746,7 +746,7 @@ static int __qcom_smd_send(struct qcom_smd_channel *channel, const void *data,
|
||||||
__le32 hdr[5] = { cpu_to_le32(len), };
|
__le32 hdr[5] = { cpu_to_le32(len), };
|
||||||
int tlen = sizeof(hdr) + len;
|
int tlen = sizeof(hdr) + len;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int ret;
|
int ret = 0;
|
||||||
|
|
||||||
/* Word aligned channels only accept word size aligned data */
|
/* Word aligned channels only accept word size aligned data */
|
||||||
if (channel->info_word && len % 4)
|
if (channel->info_word && len % 4)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user