video: driver:: handle NULL value of ctrl
In case, when control id passed by client is 0, ctrl ref will be NULL. handle such NULL ctrl by returning -EINVAL from driver. Fix: v4l2-compliance: testSimpleControls: Invalid Control. Change-Id: Ie7dfe96775dd5fe71a4e467539dd261e4ba9efaf Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
fc3bb7608f
commit
167aebba8c
@@ -379,7 +379,11 @@ int msm_vidc_g_ctrl(void *instance, struct v4l2_control *control)
|
||||
rc = msm_vidc_get_control(inst, ctrl);
|
||||
if (!rc)
|
||||
control->value = ctrl->val;
|
||||
} else {
|
||||
i_vpr_e(inst, "%s: invalid control\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (rc)
|
||||
i_vpr_e(inst, "%s: failed for control id %#x\n",
|
||||
__func__, control->id);
|
||||
|
Reference in New Issue
Block a user