Skip to contentSkip to conversation

raw: set range for MAX_RAW_DEVS

PATCH In review Paul Bolle 1 participant 1 message Feb 4, 2014 Char and misc drivers

lore
Share & tools
lore

Paul Bolle

author
#0 lore raw

PATCH 2/2 raw: set range for MAX_RAW_DEVS

The Kconfig symbol MAX_RAW_DEVS is meant to be between 1 and 65536. But those boundaries are not enforced by its Kconfig entry.

Note that MAX_RAW_DEVS is used to set MAX_RAW_MINORS in drivers/char/raw.c. If one would accidentally set MAX_RAW_DEVS to an invalid value, that invalid value will actually end up being used in raw_init().

So add an appropriate range to this Kconfig entry.

---
 drivers/char/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/char/Kconfig +1 -0
index fa3243d..1386749 100644
@@ -499,6 +499,7 @@ config RAW_DRIVER
 config MAX_RAW_DEVS
 	int "Maximum number of RAW devices to support (1-65536)"
 	depends on RAW_DRIVER
+	range 1 65536
 	default "256"
 	help
 	  The maximum number of RAW devices that are supported.
Signature · 1 line
1.8.5.3