This fixes a potential NULL pointer dereference issue as pointed out
by SVACE warning:
* DEREF_OF_NULL.ASSIGN: Pointer 'egl_api_ts', which is dereferenced
at yagl_host_egl_calls.c:184, may have NULL value.
[dereference] Dereference at hw/yagl/yagl_apis/egl/yagl_host_egl_calls.c:184
[null] Assign null at hw/yagl/yagl_apis/egl/yagl_host_egl_calls.c:182
Change-Id: I5003403ebc881fb2ebc91d9e1be132ff4d87f2e3
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
static bool yagl_egl_release_current_context(struct yagl_thread_state *cur_ts, struct yagl_egl_display *dpy)
{
- struct yagl_egl_api_ts *egl_api_ts = (cur_ts ? cur_ts->egl_api_ts : NULL);
+ struct yagl_egl_api_ts *egl_api_ts;
+
+ if (!cur_ts) {
+ return false;
+ }
+
+ egl_api_ts = cur_ts->egl_api_ts;
if (!egl_api_ts->context) {
return true;