diff options
author | 2021-06-22 16:31:53 +0200 | |
---|---|---|
committer | 2021-07-22 14:01:54 +0200 | |
commit | ba7a93e507f88306d7a19a1dcb53b857b790cfb8 (patch) | |
tree | 09da32e8b5d46177ba32deef677af2a4d3f9fcb4 /drivers/staging/media/tegra-video/vi.c | |
parent | media: go7007: remove redundant initialization (diff) | |
download | linux-dev-ba7a93e507f88306d7a19a1dcb53b857b790cfb8.tar.xz linux-dev-ba7a93e507f88306d7a19a1dcb53b857b790cfb8.zip |
media: v4l2-subdev: fix some NULL vs IS_ERR() checks
The v4l2_subdev_alloc_state() function returns error pointers, it
doesn't return NULL.
Fixes: 0d346d2a6f54 ("media: v4l2-subdev: add subdev-wide state struct")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/tegra-video/vi.c')
-rw-r--r-- | drivers/staging/media/tegra-video/vi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c index 89709cd06d4d..d321790b07d9 100644 --- a/drivers/staging/media/tegra-video/vi.c +++ b/drivers/staging/media/tegra-video/vi.c @@ -508,8 +508,8 @@ static int __tegra_channel_try_format(struct tegra_vi_channel *chan, return -ENODEV; sd_state = v4l2_subdev_alloc_state(subdev); - if (!sd_state) - return -ENOMEM; + if (IS_ERR(sd_state)) + return PTR_ERR(sd_state); /* * Retrieve the format information and if requested format isn't * supported, keep the current format. |