summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaquel Medina <raquel.medina@konsulko.com>2019-01-25 01:55:40 +0200
committerRaquel Medina <raquel.medina@konsulko.com>2019-01-25 02:07:41 +0200
commit54d90ba88f60fef57c46b713bd48cbd9e392b544 (patch)
tree3a1985fd540e33ccec11245aa8d6996c4aed6f69
parentf352283da17c024313e1de200698dda1476c612e (diff)
binding: nfc: include reply to presence event requests in error paths
AGL-Bug: SPEC-2141 Change-Id: Ic81ea3463fd51a67e6035ceff5af4039abbc5fce Signed-off-by: Raquel Medina <raquel.medina@konsulko.com>
-rw-r--r--binding/afm-nfc-binding.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/binding/afm-nfc-binding.c b/binding/afm-nfc-binding.c
index 7d0f6dc..b869a2f 100644
--- a/binding/afm-nfc-binding.c
+++ b/binding/afm-nfc-binding.c
@@ -439,10 +439,10 @@ static void subscribe(afb_req_t request)
const char *ename = afb_event_name(presence_event);
if (!value || !ename)
- return;
+ return afb_req_reply(request, NULL, "invalid", NULL);
if (strcasecmp(value, ename))
- return;
+ return afb_req_reply(request, NULL, "invalid", NULL);
if (afb_req_subscribe(request, presence_event) < 0) {
AFB_REQ_ERROR(request, "subscribe to presence_event failed");
@@ -459,10 +459,10 @@ static void unsubscribe(afb_req_t request)
const char *ename = afb_event_name(presence_event);
if (!value || !ename)
- return;
+ return afb_req_reply(request, NULL, "invalid", NULL);
if (strcasecmp(value, ename))
- return;
+ return afb_req_reply(request, NULL, "invalid", NULL);
if (afb_req_unsubscribe(request, presence_event) < 0) {
AFB_REQ_ERROR(request, "unsubscribe to presence_event failed");