Fix issue for dereference before NULL check
Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: G.n. Zhou <guoniu.zhou@nxp.com>
{
ipu_channel_params_t params;
int err = 0, sensor_protocol = 0;
- ipu_channel_t chan = (cam->csi == 0) ? CSI_MEM0 : CSI_MEM1;
+ ipu_channel_t chan;
#ifdef CONFIG_MXC_MIPI_CSI2
void *mipi_csi2_info;
int ipu_id;
printk(KERN_ERR "cam private is NULL\n");
return -ENXIO;
}
+ chan = (cam->csi == 0) ? CSI_MEM0 : CSI_MEM1;
memset(¶ms, 0, sizeof(ipu_channel_params_t));
params.csi_mem.csi = cam->csi;