]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: ccs-pll: Check for too high VT PLL multiplier in dual PLL case
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 20 Feb 2025 08:54:44 +0000 (10:54 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Fri, 25 Apr 2025 08:15:15 +0000 (10:15 +0200)
The check for VT PLL upper limit in dual PLL case was missing. Add it now.

Fixes: 6c7469e46b60 ("media: ccs-pll: Add trivial dual PLL support")
Cc: stable@vger.kernel.org
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/i2c/ccs-pll.c

index 2399cd6509b757601e9ac007aa9e1033066c69e5..266fcd160da6ef127451d0eb981736951753aa7b 100644 (file)
@@ -312,6 +312,11 @@ __ccs_pll_calculate_vt_tree(struct device *dev,
        dev_dbg(dev, "more_mul2: %u\n", more_mul);
 
        pll_fr->pll_multiplier = mul * more_mul;
+       if (pll_fr->pll_multiplier > lim_fr->max_pll_multiplier) {
+               dev_dbg(dev, "pll multiplier %u too high\n",
+                       pll_fr->pll_multiplier);
+               return -EINVAL;
+       }
 
        if (pll_fr->pll_multiplier * pll_fr->pll_ip_clk_freq_hz >
            lim_fr->max_pll_op_clk_freq_hz)