Reset vibration path when path is null 74/50574/2
authorpr.jung <pr.jung@samsung.com>
Thu, 10 Sep 2015 07:06:59 +0000 (16:06 +0900)
committerTaeyoung Kim <ty317.kim@samsung.com>
Thu, 12 Nov 2015 05:36:10 +0000 (21:36 -0800)
Change-Id: I0867a349d06243798baaebbe1ec29611f510dc3e
Signed-off-by: pr.jung <pr.jung@samsung.com>
src/vibrator.c

index c8036fc..d267ff2 100644 (file)
@@ -439,8 +439,16 @@ static int vibrator_set_path(feedback_pattern_e pattern, char *path)
 
        /*
         * check the path is valid
-        * if path is null, below operation is ignored
+        * if path is null, reset vibration path
         */
+       if (!path) {
+               if (vib_info.data[pattern].changed) {
+                       free(vib_info.data[pattern].changed);
+                       vib_info.data[pattern].changed = NULL;
+               }
+               return 0;
+       }
+
        if (path && stat(path, &buf)) {
                _E("%s is not presents", path);
                return -errno;