[bug report] media: atomisp: Add input helper variable for isp->asd->inputs[asd->input_curr]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Hans de Goede,

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

The patch 9f221053342a: "media: atomisp: Add input helper variable
for isp->asd->inputs[asd->input_curr]" from May 29, 2023, leads to
the following Smatch complaint:

    drivers/staging/media/atomisp/pci/atomisp_cmd.c:4283 atomisp_set_fmt_to_snr()
    warn: variable dereferenced before check 'asd' (see line 4268)

drivers/staging/media/atomisp/pci/atomisp_cmd.c
  4267		struct atomisp_sub_device *asd = pipe->asd;
  4268		struct atomisp_device *isp = asd->isp;
                                             ^^^^^^^^
  4269		struct atomisp_input_subdev *input = &isp->inputs[asd->input_curr];
                                                                  ^^^^^^^^^^^^^^^
These dereferences were moved in front of the NULL check

  4270		const struct atomisp_format_bridge *format;
  4271		struct v4l2_subdev_state pad_state = {
  4272			.pads = &input->pad_cfg,
  4273		};
  4274		struct v4l2_subdev_format vformat = {
  4275			.which = V4L2_SUBDEV_FORMAT_TRY,
  4276		};
  4277		struct v4l2_mbus_framefmt *ffmt = &vformat.format;
  4278		struct v4l2_mbus_framefmt *req_ffmt;
  4279		struct atomisp_input_stream_info *stream_info =
  4280		    (struct atomisp_input_stream_info *)ffmt->reserved;
  4281		int ret;
  4282	
  4283		if (!asd) {
                    ^^^^
Here

  4284			dev_err(pipe->isp->dev, "%s(): asd is NULL, device is %s\n",
  4285				__func__, vdev->name);

regards,
dan carpenter



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux