Skip to contentSkip to conversation

media: ti-vpe: Add CAL v4l2 camera capture driver

media Dan Carpenter 1 participant 1 message Feb 3, 2016 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hello Benoit Parrot,

This is a semi-automatic email about new static checker warnings.

The patch 343e89a792a5: "[media] media: ti-vpe: Add CAL v4l2 camera capture driver" from Jan 6, 2016, leads to the following Smatch complaint:

drivers/media/platform/ti-vpe/cal.c:1349 cal_start_streaming()

	 warn: variable dereferenced before check 'ctx->sensor' (see line 1332)

drivers/media/platform/ti-vpe/cal.c
1331

  1332		ret = cal_get_external_info(ctx);
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^

Dereferenced inside function call.

1333 if (ret < 0)
1334 goto err;
1335
1336 cal_runtime_get(ctx->dev);
1337
1338 enable_irqs(ctx);
1339 camerarx_phy_enable(ctx);
1340 csi2_init(ctx);
1341 csi2_phy_config(ctx);
1342 csi2_lane_config(ctx);
1343 csi2_ctx_config(ctx);
1344 pix_proc_config(ctx);
1345 cal_wr_dma_config(ctx, ctx->v_fmt.fmt.pix.bytesperline);
1346 cal_wr_dma_addr(ctx, addr);
1347 csi2_ppi_enable(ctx);
1348

  1349		if (ctx->sensor) {
                    ^^^^^^^^^^^

Checked too late.

  1350			if (v4l2_subdev_call(ctx->sensor, video, s_stream, 1)) {
  1351				ctx_err(ctx, "stream on failed in subdev\n");

regards,
dan carpenter