summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2015-02-27 18:54:59 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2015-02-27 18:54:59 +0900
commit9aa13a9765d5dea73ab36e56e50b74c84d411a4a (patch)
treec05b3a6004cd06ac479a24d8b85661d269de38be
parentb7bf5c01ffc9347d0c143724fa5112f611e76c63 (diff)
downloaddeviced-9aa13a9765d5dea73ab36e56e50b74c84d411a4a.tar.gz
deviced-9aa13a9765d5dea73ab36e56e50b74c84d411a4a.tar.bz2
deviced-9aa13a9765d5dea73ab36e56e50b74c84d411a4a.zip
When deviced is terminated, if there is no led device, it makes a segfault issue by null point access. Change-Id: I8724c9f235b090e04682d514e9de8f030b7591ca Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
-rw-r--r--src/led/torch.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/led/torch.c b/src/led/torch.c
index 6f403683..f4ad1f75 100644
--- a/src/led/torch.c
+++ b/src/led/torch.c
@@ -164,11 +164,16 @@ static int led_service_free(void)
{
struct hw_info *info;
+ if (!led_dev)
+ return -ENOENT;
+
info = led_dev->common.info;
assert(info);
info->close((struct hw_common *)led_dev);
+
+ return 0;
}
static int torch_probe(void *data)