modem: cmux: Prevent NULL deref in connect_handler
Prevent unlikely item == NULL scenario (CID 323091) and remove superflous cmux == NULL check (CID 334904) Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
This commit is contained in:
parent
96e48c91b4
commit
9633fb70a0
1 changed files with 6 additions and 3 deletions
|
|
@ -899,13 +899,16 @@ static void modem_cmux_transmit_handler(struct k_work *item)
|
|||
|
||||
static void modem_cmux_connect_handler(struct k_work *item)
|
||||
{
|
||||
struct k_work_delayable *dwork = k_work_delayable_from_work(item);
|
||||
struct modem_cmux *cmux = CONTAINER_OF(dwork, struct modem_cmux, connect_work);
|
||||
struct k_work_delayable *dwork;
|
||||
struct modem_cmux *cmux;
|
||||
|
||||
if (cmux == NULL) {
|
||||
if (item == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
dwork = k_work_delayable_from_work(item);
|
||||
cmux = CONTAINER_OF(dwork, struct modem_cmux, connect_work);
|
||||
|
||||
cmux->state = MODEM_CMUX_STATE_CONNECTING;
|
||||
|
||||
struct modem_cmux_frame frame = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue