Skip to content

Commit

Permalink
bus: imx-weim: fix valid range check
Browse files Browse the repository at this point in the history
[ Upstream commit 7bca405 ]

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: 2a88e47 ("bus: imx-weim: Remove open coded "ranges" parsing")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
lynxeye-dev authored and gregkh committed Mar 1, 2024
1 parent 9c29933 commit bc569f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/bus/imx-weim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit bc569f8

Please sign in to comment.