mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
media: mc-entity.c: use & to check pad flags, not ==
commit 044041cd52
upstream.
These are bits so to test if a pad is a sink you use & but not ==.
It looks like the only reason this hasn't caused problems before is that
media_get_pad_index() is currently only used with pads that do not set the
MEDIA_PAD_FL_MUST_CONNECT flag. So a pad really had only the SINK or SOURCE
flag set and nothing else.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: <stable@vger.kernel.org> # for v5.3 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9be09b4583
commit
37c554b3fe
1 changed files with 2 additions and 2 deletions
|
@ -639,9 +639,9 @@ int media_get_pad_index(struct media_entity *entity, bool is_sink,
|
|||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < entity->num_pads; i++) {
|
||||
if (entity->pads[i].flags == MEDIA_PAD_FL_SINK)
|
||||
if (entity->pads[i].flags & MEDIA_PAD_FL_SINK)
|
||||
pad_is_sink = true;
|
||||
else if (entity->pads[i].flags == MEDIA_PAD_FL_SOURCE)
|
||||
else if (entity->pads[i].flags & MEDIA_PAD_FL_SOURCE)
|
||||
pad_is_sink = false;
|
||||
else
|
||||
continue; /* This is an error! */
|
||||
|
|
Loading…
Reference in a new issue