parport_serial: fix array overflow

The netmos_9xx5_combo type assumes that PCI SSID provides always the
correct value for the number of parallel and serial ports, but there are
indeed broken devices with wrong numbers, which may result in Oops.

This patch simply adds the check of the array range.

Reference: Novell bnc#447067
https://bugzilla.novell.com/show_bug.cgi?id=447067

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Takashi Iwai and committed by Linus Torvalds 36be47d6 dc19f9db

+2
+2
drivers/parport/parport_serial.c
··· 70 70 * parallel ports and <S> is the number of serial ports. 71 71 */ 72 72 card->numports = (dev->subsystem_device & 0xf0) >> 4; 73 + if (card->numports > ARRAY_SIZE(card->addr)) 74 + card->numports = ARRAY_SIZE(card->addr); 73 75 return 0; 74 76 } 75 77