drivers: modem: hl7800: fix possible null reference
Ensure sock is not referenced if it is null. Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
This commit is contained in:
parent
2919989ee9
commit
a7b61fa2a8
1 changed files with 2 additions and 1 deletions
|
@ -2776,7 +2776,7 @@ static void sock_read(struct net_buf **buf, uint16_t len)
|
|||
sock = socket_from_id(ictx.last_socket_id);
|
||||
if (!sock) {
|
||||
LOG_ERR("Socket not found! (%d)", ictx.last_socket_id);
|
||||
goto done;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (sock->error) {
|
||||
|
@ -2913,6 +2913,7 @@ done:
|
|||
} else {
|
||||
sock->state = SOCK_IDLE;
|
||||
}
|
||||
exit:
|
||||
allow_sleep(true);
|
||||
hl7800_TX_unlock();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue