msm: vidc: send release buffers cmd during instance clean up

During instance cleanup, if internal or output buffer
list is not empty, respective buffers are unmapped.
Modify the cleanup instance to send release buffers to
video core if internal or output buffer list is not
empty and then unmap the respective buffers.

CRs-Fixed: 619239
Change-Id: I56bd4248173992dedfb36098dfa9ddf35fc12a4e
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
msm: vidc: change error msg for max sessions condition

When the max sessions condition is reached, the firmware
sends session init to the driver. Change the error message
from 'core is in a bad state' to reflect the actual
behavior.

CRs-fixed: 625684
Change-Id: Iddf7d3fc72c1c2696200789954c1e69fd0419dca
Signed-off-by: Pushkaraj Patil <ppatil@codeaurora.org>
msm: vidc: add kzalloc success check for new HAL session

Memory allocation must be verified before proceeding.

CRs-Fixed: 606527
Change-Id: Ic340bf9926f84507294c576997948ddbe61dd62f
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: vidc: add input parameter checks to exported functions

Check for invalid null parameter passed to functions

CRs-Fixed: 606467
Change-Id: I860ca3d69d8705c7b3d6f27f9504b567be5aeea3
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: vidc: add kzalloc success check for new q6 HAL session

Memory allocation must be verified before proceeding.

CRs-Fixed: 606522
Change-Id: I809acc21dcd5e680827feb5d0fa8f45814bf4773
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: vidc: add input check for hfi q6 function.

The input parameters may be null. This change adds input checks at
function q6_hfi_iface_eventq_read

CRs-Fixed: 606516
Change-Id: I801a9d3249e9b97fa218fc29bc3a2a0e7a0d4d3f
Signed-off-by: Prasad Nallani <pnalla@codeaurora.org>
msm: vidc: Add null pointer checks

msm_vidc_inst pointer instance is used in without any null
pointer check, dereferencing t could device crash.
Fix the issue by adding null pointer checks.

Change-Id: Ia17b380063326aa587aac941aac0131871147e8a
CRs-Fixed: 606486,606469
Signed-off-by: Jayasena Sangaraboina <jsanga@codeaurora.org>
YT #5