Merge tag 'v4.3-rc3' into next
[firefly-linux-kernel-4.4.55.git] / drivers / input / joystick / turbografx.c
index 5f7382af70c9e76c7c09477a0aae7faa1b013954..01e8ea92b9ad892ce99e7ca5801ee38c8512f955 100644 (file)
@@ -205,7 +205,7 @@ static void tgfx_attach(struct parport *pp)
                if (n_buttons[i] < 1)
                        continue;
 
-               if (n_buttons[i] > 6) {
+               if (n_buttons[i] > ARRAY_SIZE(tgfx_buttons)) {
                        printk(KERN_ERR "turbografx.c: Invalid number of buttons %d\n", n_buttons[i]);
                        goto err_unreg_devs;
                }