pio: return error when open is failed 95/165595/1
authorkibak.yoon <kibak.yoon@samsung.com>
Tue, 2 Jan 2018 08:16:54 +0000 (17:16 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Tue, 2 Jan 2018 08:16:54 +0000 (17:16 +0900)
- to prevent explicite null dereferenced, error should be returned when
  open is failed.

Change-Id: I645dec3879d54d43edec1ba52ace84af6c86b180
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
src/peripheral_gpio.c

index b51c577..e5a3d8c 100644 (file)
@@ -69,6 +69,7 @@ int peripheral_gpio_open(int gpio_pin, peripheral_gpio_h *gpio)
                _E("Failed to open the gpio pin, ret : %d", ret);
                free(handle);
                handle = NULL;
+               return ret;
        }
 
        ret = peripheral_interface_gpio_set_initial_direction_into_handle(handle);