Normally kgsl_create_context() returns a pointer to a new context. In case of errors it just returns NULL pointer, and that doesn't allow to propagate the right error code back to the user via kgsl_ioctl_drawctxt_create() This fix modifies kgsl_create_context to use ERR_PTR macro for passing error codes to its caller. Change-Id: I447c1765828912b0994bcae67a73864e62eef9b6 Signed-off-by: Vladimir Razgulin <vrazguli@codeaurora.org> Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>