[bug report] media: rzg2l-cru: Retrieve virtual channel information

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

 



Hello Lad Prabhakar,

Commit d7d72dae81d5 ("media: rzg2l-cru: Retrieve virtual channel
information") from Oct 18, 2024 (linux-next), leads to the following
Smatch static checker warning:

	drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c:322 rzg2l_cru_get_virtual_channel()
	error: 'remote_pad' dereferencing possible ERR_PTR()

drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
    315 static int rzg2l_cru_get_virtual_channel(struct rzg2l_cru_dev *cru)
    316 {
    317         struct v4l2_mbus_frame_desc fd = { };
    318         struct media_pad *remote_pad;
    319         int ret;
    320 
    321         remote_pad = media_pad_remote_pad_unique(&cru->ip.pads[RZG2L_CRU_IP_SINK]);

Does media_pad_remote_pad_unique() need error checking?

--> 322         ret = v4l2_subdev_call(cru->ip.remote, pad, get_frame_desc, remote_pad->index, &fd);
    323         if (ret < 0 && ret != -ENOIOCTLCMD) {
    324                 dev_err(cru->dev, "get_frame_desc failed on IP remote subdev\n");
    325                 return ret;
    326         }
    327         /* If remote subdev does not implement .get_frame_desc default to VC0. */
    328         if (ret == -ENOIOCTLCMD)
    329                 return 0;
    330 
    331         if (fd.type != V4L2_MBUS_FRAME_DESC_TYPE_CSI2) {
    332                 dev_err(cru->dev, "get_frame_desc returned invalid bus type %d\n", fd.type);
    333                 return -EINVAL;
    334         }
    335 
    336         if (!fd.num_entries) {
    337                 dev_err(cru->dev, "get_frame_desc returned zero entries\n");
    338                 return -EINVAL;
    339         }
    340 
    341         return fd.entry[0].bus.csi2.vc;
    342 }

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