diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2020-02-04 19:19:22 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-03-12 13:00:21 +0100 |
commit | 37c554b3fe987f95d75a0a981ce204240756d851 (patch) | |
tree | f4cf7b9895dc24e0f10d43b6bf866d1ba0e94737 /drivers/media/mc | |
parent | 9be09b4583f1e1e691f83274008ac7e003c86e31 (diff) | |
download | linux-rt-37c554b3fe987f95d75a0a981ce204240756d851.tar.gz |
media: mc-entity.c: use & to check pad flags, not ==
commit 044041cd5227ec9ccf969f4bf1cc08bffe13b9d3 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>
Diffstat (limited to 'drivers/media/mc')
-rw-r--r-- | drivers/media/mc/mc-entity.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c index 7c429ce98bae..668770e9f609 100644 --- a/drivers/media/mc/mc-entity.c +++ b/drivers/media/mc/mc-entity.c @@ -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! */ |