drivers: modem: fix sending with zero timeout and no semaphore

There was a regression introduced when reordering function parameters
check. It is valid to pass NULL semaphore with zero timeout, so fix
parameter check to respect that.

Fixes: 67976f8686 ("drivers: modem: verify send semaphore before
  taking any action")
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
This commit is contained in:
Marcin Niestroj 2020-12-04 19:39:10 +01:00 committed by Jukka Rissanen
commit 5cbf2ec1f7

View file

@ -477,7 +477,7 @@ static int _modem_cmd_send(struct modem_iface *iface,
struct modem_cmd_handler_data *data;
int ret;
if (!iface || !handler || !handler->cmd_handler_data || !buf || !sem) {
if (!iface || !handler || !handler->cmd_handler_data || !buf) {
return -EINVAL;
}