From: Sangchul Lee Date: Wed, 8 Aug 2018 06:41:04 +0000 (+0900) Subject: Fix coverity issues X-Git-Tag: submit/tizen/20180808.083139^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f859a9a2044afa14f08de27779849b3efd0135a7;p=platform%2Fcore%2Fmultimedia%2Flibmm-sound.git Fix coverity issues [Version] 0.12.26 [Issue Type] Coverity Change-Id: Ibea05053ed04c21c347471d9e885206ca944afc9 Signed-off-by: Sangchul Lee --- diff --git a/focus_server/mm_sound_mgr_focus_socket.c b/focus_server/mm_sound_mgr_focus_socket.c index ae5f6b7..dabe22c 100644 --- a/focus_server/mm_sound_mgr_focus_socket.c +++ b/focus_server/mm_sound_mgr_focus_socket.c @@ -400,7 +400,8 @@ static void* ready_thread_func(void *data) LEAVE: debug_fleave(); pthread_attr_destroy(&attr); - close(fd); + if (fd != -1) + close(fd); pthread_exit(NULL); } diff --git a/mm_sound_focus_socket.c b/mm_sound_focus_socket.c index 1e7c0db..152e203 100644 --- a/mm_sound_focus_socket.c +++ b/mm_sound_focus_socket.c @@ -193,7 +193,7 @@ int mm_sound_focus_socket_register(int pid, const char *stream_type, int *client memset(&data, 0x00, sizeof(_mm_sound_focus_socket_param_t)); memset(&result, 0x00, sizeof(_mm_sound_focus_socket_result_t)); FILL_SOCKET_PARAM_REGISTER(data, FOCUS_FUNC_NAME_REGISTER, pid, stream_type); - if ((ret = _send_data_to_server(*client_fd, &data, &result)) < 0) { + if ((ret = _send_data_to_server(*client_fd, &data, &result))) { debug_error("failed to _send_data_to_server(), ret[0x%x]", ret); close(*client_fd); return ret; @@ -257,7 +257,7 @@ int mm_sound_focus_socket_add_watch_cb(int pid, mm_sound_focus_type_e focus_type memset(&data, 0x00, sizeof(_mm_sound_focus_socket_param_t)); memset(&result, 0x00, sizeof(_mm_sound_focus_socket_result_t)); FILL_SOCKET_PARAM_ADD_WATCH(data, FOCUS_FUNC_NAME_ADD_WATCH, pid, focus_type); - if ((ret = _send_data_to_server(*client_fd, &data, &result)) < 0) { + if ((ret = _send_data_to_server(*client_fd, &data, &result))) { debug_error("failed to _send_data_to_server(), ret[0x%x]", ret); close(*client_fd); return ret; diff --git a/packaging/libmm-sound.spec b/packaging/libmm-sound.spec index 00d815b..a2e2273 100644 --- a/packaging/libmm-sound.spec +++ b/packaging/libmm-sound.spec @@ -1,6 +1,6 @@ Name: libmm-sound Summary: MMSound Package contains client lib and sound_server binary -Version: 0.12.25 +Version: 0.12.26 Release: 0 Group: System/Libraries License: Apache-2.0