Input: db9 - clear unused function pointers
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Tue, 17 Nov 2015 17:33:14 +0000 (09:33 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 17 Nov 2015 18:00:12 +0000 (10:00 -0800)
db9_parport_cb is a local uninitialized structure and the member
function pointers will be pointing to arbitrary locations unless they
are cleared.

Fixes: 2260c419b52b ("Input: db9 - use parallel port device model")
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/joystick/db9.c

index 932d07307454bd47441da61ff06e3ef03ea93cd4..da326090c2b0e7f07ab4de5668012b1a4d5e92f3 100644 (file)
@@ -592,6 +592,7 @@ static void db9_attach(struct parport *pp)
                return;
        }
 
+       memset(&db9_parport_cb, 0, sizeof(db9_parport_cb));
        db9_parport_cb.flags = PARPORT_FLAG_EXCL;
 
        pd = parport_register_dev_model(pp, "db9", &db9_parport_cb, port_idx);