aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/saa7134/saa7134-video.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-11-10 09:10:51 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-11-17 07:13:27 +0100
commit23ffa0399c693246a7442b98d71265e92e827912 (patch)
tree37d9faadddca426b7e67f549ccba4409c9dffb6c /drivers/media/pci/saa7134/saa7134-video.c
parentmedia: cx231xx: Use snd_card_free_when_closed() instead of snd_card_free(). (diff)
downloadlinux-dev-23ffa0399c693246a7442b98d71265e92e827912.tar.xz
linux-dev-23ffa0399c693246a7442b98d71265e92e827912.zip
media: saa7134: improve f->fmt.win.clips NULL check
Fix this smatch error: saa7134-video.c:1286 saa7134_g_fmt_vid_overlay() error: we previously assumed 'f->fmt.win.clips' could be null (see line 1279) This is actually a false error since if f->fmt.win.clips is NULL, clipcount will be set to 0, so the clips array won't be touched, but it doesn't hurt to make this explicit in the code. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/pci/saa7134/saa7134-video.c')
-rw-r--r--drivers/media/pci/saa7134/saa7134-video.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
index c24716f4ce23..0f9d6b9edb90 100644
--- a/drivers/media/pci/saa7134/saa7134-video.c
+++ b/drivers/media/pci/saa7134/saa7134-video.c
@@ -1276,8 +1276,10 @@ static int saa7134_g_fmt_vid_overlay(struct file *file, void *priv,
return -EINVAL;
}
f->fmt.win = dev->win;
- if (!f->fmt.win.clips)
- clipcount = 0;
+ if (!f->fmt.win.clips) {
+ f->fmt.win.clipcount = 0;
+ return 0;
+ }
if (dev->nclips < clipcount)
clipcount = dev->nclips;
f->fmt.win.clipcount = clipcount;