aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.15/950-0732-media-i2c-ov7251-Fix-link_freq-validation-loop.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/bcm27xx/patches-5.15/950-0732-media-i2c-ov7251-Fix-link_freq-validation-loop.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.15/950-0732-media-i2c-ov7251-Fix-link_freq-validation-loop.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.15/950-0732-media-i2c-ov7251-Fix-link_freq-validation-loop.patch b/target/linux/bcm27xx/patches-5.15/950-0732-media-i2c-ov7251-Fix-link_freq-validation-loop.patch
new file mode 100644
index 0000000000..560b31d852
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.15/950-0732-media-i2c-ov7251-Fix-link_freq-validation-loop.patch
@@ -0,0 +1,33 @@
+From fd7067bd245a90d957b70ce8be96b2a4d7b970a6 Mon Sep 17 00:00:00 2001
+From: Dave Stevenson <dave.stevenson@raspberrypi.com>
+Date: Thu, 17 Feb 2022 15:57:01 +0000
+Subject: [PATCH] media: i2c: ov7251: Fix link_freq validation loop
+
+If only one link frequency was configured, then ov7251_check_hwcfg
+failed as the conditions weren't checked in the appropriate places.
+
+Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
+---
+ drivers/media/i2c/ov7251.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/media/i2c/ov7251.c
++++ b/drivers/media/i2c/ov7251.c
+@@ -1390,14 +1390,14 @@ static int ov7251_check_hwcfg(struct ov7
+
+ freq_found = false;
+ for (i = 0; i < bus_cfg.nr_of_link_frequencies; i++) {
+- if (freq_found)
+- break;
+-
+ for (j = 0; j < ARRAY_SIZE(link_freq); j++)
+ if (bus_cfg.link_frequencies[i] == link_freq[j]) {
+ freq_found = true;
+ break;
+ }
++
++ if (freq_found)
++ break;
+ }
+
+ if (i == bus_cfg.nr_of_link_frequencies) {