Skip to content

Commit

Permalink
Input: turbografx - clear unused function pointers
Browse files Browse the repository at this point in the history
tgfx_parport_cb is a local uninitialized structure and the member
function pointers will be pointing to arbitrary locations unless they
are cleared.

Fixes: 4de27a6 ("Input: turbografx - use parallel port device model")
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Sudip Mukherjee authored and Dmitry Torokhov committed Nov 17, 2015
1 parent eb12a5f commit 3855e9e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/input/joystick/turbografx.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ static void tgfx_attach(struct parport *pp)
n_buttons = tgfx_cfg[port_idx].args + 1;
n_devs = tgfx_cfg[port_idx].nargs - 1;

memset(&tgfx_parport_cb, 0, sizeof(tgfx_parport_cb));
tgfx_parport_cb.flags = PARPORT_FLAG_EXCL;

pd = parport_register_dev_model(pp, "turbografx", &tgfx_parport_cb,
Expand Down

0 comments on commit 3855e9e

Please sign in to comment.