drivers: modem: Fix Coverity issue in ublox-sara-r4.c
Coverity reported unused value for a variable "ret" in the function send_socket_data(). Indeed there were two subsequent assignments to "ret", meaning that the first one was unused. The root cause of the problem is not checking the value of "ret" after correctly invoking a function within send_socket_data(). Fix this by adding appropriate checks. Coverity-CID: 215249 Signed-off-by: Aleksandar Markovic <aleksandar.markovic.sa@gmail.com>
This commit is contained in:
parent
df5d1f220b
commit
4b0252eab3
1 changed files with 5 additions and 0 deletions
|
@ -343,6 +343,11 @@ static ssize_t send_socket_data(void *obj,
|
|||
}
|
||||
|
||||
ret = modem_context_get_addr_port(dst_addr, &dst_port);
|
||||
if (ret != 0) {
|
||||
LOG_ERR("Error getting port from IP address %d", ret);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
snprintk(send_buf, sizeof(send_buf),
|
||||
"AT+USOST=%d,\"%s\",%u,%zu", sock->id,
|
||||
ip_str,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue