summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorShaobo He2019-02-28 23:54:06 +0100
committerMauro Carvalho Chehab2019-03-19 18:49:19 +0100
commit2c2a8dc32cebb71e42cfc2ed1bd433cbec792207 (patch)
treefbb6ae612471441d88a63a1a2d88f97dbdaeb3fa /drivers
parentmedia: cpia2: Fix use-after-free in cpia2_exit (diff)
downloadkernel-qcow2-linux-2c2a8dc32cebb71e42cfc2ed1bd433cbec792207.tar.gz
kernel-qcow2-linux-2c2a8dc32cebb71e42cfc2ed1bd433cbec792207.tar.xz
kernel-qcow2-linux-2c2a8dc32cebb71e42cfc2ed1bd433cbec792207.zip
media: platform/sh_veu.c: remove redundant NULL pointer checks
Function `sh_veu_find_fmt` returns an address that is an addition of a base pointer `sh_veu_fmt` and an offset. The base pointer refers to a global variable of which address cannot be NULL. Therefore, this commit removes the NULL pointer checks on the return values of function `sh_veu_find_fmt`. Signed-off-by: Shaobo He <shaobo@cs.utah.edu> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/platform/sh_veu.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c
index d277cc674349..5a9ba05c996e 100644
--- a/drivers/media/platform/sh_veu.c
+++ b/drivers/media/platform/sh_veu.c
@@ -493,9 +493,6 @@ static int sh_veu_try_fmt_vid_cap(struct file *file, void *priv,
const struct sh_veu_format *fmt;
fmt = sh_veu_find_fmt(f);
- if (!fmt)
- /* wrong buffer type */
- return -EINVAL;
return sh_veu_try_fmt(f, fmt);
}
@@ -506,9 +503,6 @@ static int sh_veu_try_fmt_vid_out(struct file *file, void *priv,
const struct sh_veu_format *fmt;
fmt = sh_veu_find_fmt(f);
- if (!fmt)
- /* wrong buffer type */
- return -EINVAL;
return sh_veu_try_fmt(f, fmt);
}