There is an issue which negative file descriptor can be attempt to
close in static analysis tool result. This patch fixes to skip close
on that case.
Change-Id: Ic68803bc96ab6e3737d1bcc4779b8e3c58c7ef71
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
ret = open(path, O_RDONLY);
if (ret < 0)
- goto close_file;
+ goto free_data;
fdata->fd = ret;
close_file:
close(ret);
+free_data:
free(fdata);
return -EINVAL;
}