Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: vivid: fix assignment of dev->fbuf_out_flags

Currently the chroma_flags and alpha_flags are being zero'd with a bit-wise
mask and the following statement should be bit-wise or'ing in the new flag
bits but instead is making a direct assignment. Fix this by using the |=
operator rather than an assignment.

Addresses-Coverity: ("Unused value")

Fixes: ef834f7836ec ("[media] vivid: add the video capture and output parts")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Colin Ian King and committed by
Mauro Carvalho Chehab
5cde22fc 29a42595

+1 -1
+1 -1
drivers/media/test-drivers/vivid/vivid-vid-out.c
··· 1021 1021 return -EINVAL; 1022 1022 } 1023 1023 dev->fbuf_out_flags &= ~(chroma_flags | alpha_flags); 1024 - dev->fbuf_out_flags = a->flags & (chroma_flags | alpha_flags); 1024 + dev->fbuf_out_flags |= a->flags & (chroma_flags | alpha_flags); 1025 1025 return 0; 1026 1026 } 1027 1027