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-02-21 17:29:17 +0000
commit357ff9e128024a05a91b9080f69568393acb804c (patch)
treeaf5f1b5cfad2522606e6bc5ee891eaef3acd57a8
parentb691f6a612beb9e2f77d0c226da6b580eeeee5a6 (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> (cherry picked from commit 54d90ba88f60fef57c46b713bd48cbd9e392b544)
-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");