mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 11:48:58 -04: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")
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/aAkhvV0nSbrsef1P@stanley.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
45f0de4f8d
commit
77feb17c95
@@ -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