Fix bug on checking error conditions when calling dlsym()
[Issue#] N/A
[Problem] A bug on checking error conditions when calling dlsym()
[Cause] Missed to call dlerror() to clear any old error conditions.
[Solution] Added dlerror() before calling dlsym().
Also, separated error conditions:
one for dlsym related error and another for DRM API related error.
[Remarks] DLOPEN(3)
The function dlsym() takes a "handle" of a dynamic library returned by
dlopen() and the null-terminated symbol name, returning the address where
that symbol is loaded into memory. If the symbol is not found, in the
specified library or any of the libraries that were automatically loaded
by dlopen() when that library was loaded, dlsym() returns NULL. (The
search performed by dlsym() is breadth first through the dependency tree
of these libraries.) Since the value of the symbol could actually be
NULL (so that a NULL return from dlsym() need not indicate an error), the
correct way to test for an error is to call dlerror() to clear any old
error conditions, then call dlsym(), and then call dlerror() again, sav‐
ing its return value into a variable, and check whether this saved value
is not NULL.
Change-Id: Idee1834fbdcfee184d07f757c871994e9832d7d4