]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/parport/parport_serial.c
parport_serial: fix array overflow
[linux-2.6-omap-h63xx.git] / drivers / parport / parport_serial.c
index bd6ad8b38168a43b3def14876deb7095b6117da9..101ed49a2d15609937acbcf964274ed3f12d8360 100644 (file)
@@ -70,6 +70,8 @@ static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc
         * parallel ports and <S> is the number of serial ports.
         */
        card->numports = (dev->subsystem_device & 0xf0) >> 4;
+       if (card->numports > ARRAY_SIZE(card->addr))
+               card->numports = ARRAY_SIZE(card->addr);
        return 0;
 }
 
@@ -77,7 +79,7 @@ static struct parport_pc_pci cards[] __devinitdata = {
        /* titan_110l */                { 1, { { 3, -1 }, } },
        /* titan_210l */                { 1, { { 3, -1 }, } },
        /* netmos_9xx5_combo */         { 1, { { 2, -1 }, }, netmos_parallel_init },
-       /* netmos_9855 */               { 1, { { 0, -1 }, }, netmos_parallel_init },
+       /* netmos_9855 */               { 1, { { 2, -1 }, }, netmos_parallel_init },
        /* avlab_1s1p     */            { 1, { { 1, 2}, } },
        /* avlab_1s2p     */            { 2, { { 1, 2}, { 3, 4 },} },
        /* avlab_2s1p     */            { 1, { { 2, 3}, } },
@@ -185,7 +187,7 @@ static struct pciserial_board pci_parport_serial_boards[] __devinitdata = {
                .uart_offset    = 8,
        },
        [netmos_9855] = {
-               .flags          = FL_BASE2 | FL_BASE_BARS,
+               .flags          = FL_BASE4 | FL_BASE_BARS,
                .num_ports      = 1,
                .base_baud      = 115200,
                .uart_offset    = 8,