Skip to content

Commit 032b908

Browse files
mniestrojmbolivar-nordic
authored andcommitted
modem: simcom-sim7080: fix handling failed fragment send in sendmsg()
If one data fragment was not sent successfully in sendmsg(), then attempting to send the rest does not make any sense, as it would introduce hole in data stream. Currently if one fragment was not sent successfully, then there is a 'break' in inner loop, but that moves the execution to sending the following data fragments. Return early in case of fragment sending failure, so that there are no more send attempts. Signed-off-by: Marcin Niestroj <[email protected]>
1 parent f6a6843 commit 032b908

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/modem/simcom-sim7080.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,7 @@ static ssize_t offload_sendmsg(void *obj, const struct msghdr *msg, int flags)
468468
if (ret == -EAGAIN) {
469469
k_sleep(K_SECONDS(1));
470470
} else {
471-
sent = ret;
472-
break;
471+
return ret;
473472
}
474473
} else {
475474
sent += ret;

0 commit comments

Comments
 (0)