From 54d90ba88f60fef57c46b713bd48cbd9e392b544 Mon Sep 17 00:00:00 2001 From: Raquel Medina Date: Fri, 25 Jan 2019 01:55:40 +0200 Subject: binding: nfc: include reply to presence event requests in error paths AGL-Bug: SPEC-2141 Change-Id: Ic81ea3463fd51a67e6035ceff5af4039abbc5fce Signed-off-by: Raquel Medina --- binding/afm-nfc-binding.c | 8 ++++---- 1 file 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"); -- cgit 1.2.3-korg