summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-06-07 15:41:40 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-06-07 15:41:40 +0200
commit290b13d6182a9e682292819fb13e2ed3d0b607da (patch)
treeb2d3e8aed7ad221d9e9d4aff2a82b4cc0ba30021
parent14a0633bcf46248b3892a5ab249338fd1cd3a6aa (diff)
Possible uninitialized variable returned.
Change-Id: Id6ffed520aa238304afdddcd37a64e93002196aa Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--CAN-binder/low-can-binding/binding/low-can-cb.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/CAN-binder/low-can-binding/binding/low-can-cb.cpp b/CAN-binder/low-can-binding/binding/low-can-cb.cpp
index 5a877af5..fbe6e196 100644
--- a/CAN-binder/low-can-binding/binding/low-can-cb.cpp
+++ b/CAN-binder/low-can-binding/binding/low-can-cb.cpp
@@ -134,7 +134,7 @@ static int create_event_handle(std::shared_ptr<low_can_subscription_t>& can_subs
/// against the application framework using that event handle.
static int subscribe_unsubscribe_signal(struct afb_req request, bool subscribe, std::shared_ptr<low_can_subscription_t>& can_subscription, std::map<int, std::shared_ptr<low_can_subscription_t> >& s)
{
- int ret;
+ int ret = -1;
int sub_index = can_subscription->get_index();
if (can_subscription && s.find(sub_index) != s.end())
@@ -144,6 +144,7 @@ static int subscribe_unsubscribe_signal(struct afb_req request, bool subscribe,
NOTICE(binder_interface, "%s: Event isn't valid, no need to unsubscribed.", __FUNCTION__);
ret = -1;
}
+ ret = 0;
}
else
{