Skip to content

Commit 5de775d

Browse files
Dan Carpenterandersson
authored andcommitted
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: 33e3820 ("rpmsg: smd: Use spinlock in tx path") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 75499b3 commit 5de775d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/rpmsg/qcom_smd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ static int __qcom_smd_send(struct qcom_smd_channel *channel, const void *data,
746746
__le32 hdr[5] = { cpu_to_le32(len), };
747747
int tlen = sizeof(hdr) + len;
748748
unsigned long flags;
749-
int ret;
749+
int ret = 0;
750750

751751
/* Word aligned channels only accept word size aligned data */
752752
if (channel->info_word && len % 4)

0 commit comments

Comments
 (0)