Message ID | 20240119185026.1192333-1-l.stach@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | bus: imx-weim: fix valid range check | expand |
On Fri, Jan 19, 2024 at 07:50:26PM +0100, Lucas Stach wrote: > When the range parsing was open-coded the number of u32 entries to > parse had to be a multiple of 4 and the driver checks this. With > the range parsing converted to the range parser the counting changes > from individual u32 entries to a complete range, so the check must > not reject counts not divisible by 4. > > Fixes: 2a88e4792c6d ("bus: imx-weim: Remove open coded "ranges" parsing") > Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Applied, thanks!
diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c index 42c9386a7b42..f9fd1582f150 100644 --- a/drivers/bus/imx-weim.c +++ b/drivers/bus/imx-weim.c @@ -117,7 +117,7 @@ static int imx_weim_gpr_setup(struct platform_device *pdev) i++; } - if (i == 0 || i % 4) + if (i == 0) goto err; for (i = 0; i < ARRAY_SIZE(gprvals); i++) {
When the range parsing was open-coded the number of u32 entries to parse had to be a multiple of 4 and the driver checks this. With the range parsing converted to the range parser the counting changes from individual u32 entries to a complete range, so the check must not reject counts not divisible by 4. Fixes: 2a88e4792c6d ("bus: imx-weim: Remove open coded "ranges" parsing") Signed-off-by: Lucas Stach <l.stach@pengutronix.de> --- drivers/bus/imx-weim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)