Skip to content

Commit 827e092

Browse files
bniedermayrkrzk
authored andcommitted
memory: omap-gpmc: fix wait pin validation
This bug has been introduced after switching from -1 to UINT_MAX for GPMC_WAITPIN_INVALID. The bug leads to an error when the optional gpmc,wait-pin dt-property is not used: ... gpmc_cs_program_settings: invalid wait-pin (-1) ... Signed-off-by: Benedikt Niedermayr <[email protected]> Fixes: 8dd7e4a ("memory: omap-gpmc: fix coverity issue "Control flow issues"") Acked-by: Roger Quadros <[email protected]> Tested-by: Tony Lindgren <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Kozlowski <[email protected]>
1 parent 1b929c0 commit 827e092

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/memory/omap-gpmc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1918,7 +1918,8 @@ int gpmc_cs_program_settings(int cs, struct gpmc_settings *p)
19181918
}
19191919
}
19201920

1921-
if (p->wait_pin > gpmc_nr_waitpins) {
1921+
if (p->wait_pin != GPMC_WAITPIN_INVALID &&
1922+
p->wait_pin > gpmc_nr_waitpins) {
19221923
pr_err("%s: invalid wait-pin (%d)\n", __func__, p->wait_pin);
19231924
return -EINVAL;
19241925
}

0 commit comments

Comments
 (0)