From: Romain Forlot Date: Wed, 7 Jun 2017 13:41:40 +0000 (+0200) Subject: Possible uninitialized variable returned. X-Git-Tag: Renesas_delivery_Q2~22 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=290b13d6182a9e682292819fb13e2ed3d0b607da;p=apps%2Flow-level-can-service.git Possible uninitialized variable returned. Change-Id: Id6ffed520aa238304afdddcd37a64e93002196aa Signed-off-by: Romain Forlot --- 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 5a877af..fbe6e19 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& can_subs /// against the application framework using that event handle. static int subscribe_unsubscribe_signal(struct afb_req request, bool subscribe, std::shared_ptr& can_subscription, std::map >& 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 {