mqtt: fix: pinreq handler function exit condition
The previous version of the pingreq handler function leaves the semaphore blocked if an error condition is detected. This patch solves the above described situation. Change-Id: I4897609fae3f6523244892ae38ffdc5ae85f852d Signed-off-by: Flavio Santes <flavio.santes@intel.com>
This commit is contained in:
parent
2968b3644c
commit
f8b30eada7
1 changed files with 5 additions and 4 deletions
|
@ -569,17 +569,18 @@ int mqtt_handle_pingreq(struct mqtt_app_ctx_t *app)
|
|||
|
||||
rc = mqtt_pack_pingresp(tx_buf);
|
||||
if (rc != 0) {
|
||||
return -EINVAL;
|
||||
rc = -EINVAL;
|
||||
goto error_mqtt_pack_pingresp;
|
||||
}
|
||||
|
||||
rc = netz_tx(netz_ctx, tx_buf);
|
||||
if (rc != 0) {
|
||||
nano_sem_give(&app->sem);
|
||||
return -EIO;
|
||||
rc = -EIO;
|
||||
}
|
||||
|
||||
error_mqtt_pack_pingresp:
|
||||
nano_sem_give(&app->sem);
|
||||
return 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
int mqtt_read(struct mqtt_app_ctx_t *app)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue