Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8546e3ce authored by Krzysztof Helt's avatar Krzysztof Helt Committed by Geert Uytterhoeven
Browse files

fbdev: atafb - add palette register check



Add check if palette register number is in correct range
for few drivers which miss it. The regno value comes
indirectly from user space.

Signed-off-by: default avatarKrzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
parent 87fbaf6a
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -2242,6 +2242,9 @@ static int ext_setcolreg(unsigned int regno, unsigned int red,
	if (!external_vgaiobase)
	if (!external_vgaiobase)
		return 1;
		return 1;


	if (regno > 255)
		return 1;

	switch (external_card_type) {
	switch (external_card_type) {
	case IS_VGA:
	case IS_VGA:
		OUTB(0x3c8, regno);
		OUTB(0x3c8, regno);