Skip to content
Commit 67976f86 authored by Marcin Niestroj's avatar Marcin Niestroj Committed by Anas Nashif
Browse files

drivers: modem: verify send semaphore before taking any action



Semaphore argument is checked only after requested command is already
sent over modem interface. It makes little sense to return -EINVAL when
half of the requested operation (send) has already been done.

Check timeout and semaphore arguments just on the beginning of
function. Return -EINVAL early, before sending any data or taking any
locks.

Clear out 'sem' variable when there is no need to wait. Use this
variable later on as an indication to actually wait on semaphore or not.

Signed-off-by: default avatarMarcin Niestroj <m.niestroj@grinn-global.com>
parent 555408d4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment