msm: camera: Check if client is NULL before calling ion_free

NULL check was added inorder to prevent a target reboot in ion_free
in case client is already NULL

Change-Id: I263f56ff06ad7907c459b4f7254fc1435a41c61d
Signed-off-by: Aditya Jonnalagadda <ajonnala@codeaurora.org>
Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
msm: camera: Fix camera crash in msm_open_config

Add proper check before accessing mctl handle to
avoid camera crash.

Change-Id: I1413f086ab7d94fe223a814bb16867d1dcc0a4bf
CRs-Fixed: 481757
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
msm: camera: Fix camera crash when ctrl_q is empty

Add proper error condition if the list is empty and
return error value to upper layers instead of BUG_ON.

Change-Id: I89237e7a27d5fb1e1fd5f1a8a2dfd7ea9a1afff5
CRs-Fixed: 481759
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
msm: camera: Fix mctl release crash issue.

After mctl release initialize pointer to NULL to
avoid crash.

Change-Id: Ia3e0b1b809f85760a92b5248f402df589c6ace04
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>