X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Finput%2Fjoystick%2Fguillemot.c;h=dbc5d92858b82f885e3c3758f4af9f1d624282ce;hb=6bfe5c9d6f4dcaa998f67e691359cf7b1c4b443d;hp=6e2c721c26bae3229b9a0a1a87a15f547a416dec;hpb=1f04c0a24b2f3cfe89c802a24396263623e3512d;p=linux-2.6-omap-h63xx.git diff --git a/drivers/input/joystick/guillemot.c b/drivers/input/joystick/guillemot.c index 6e2c721c26b..dbc5d92858b 100644 --- a/drivers/input/joystick/guillemot.c +++ b/drivers/input/joystick/guillemot.c @@ -222,7 +222,7 @@ static int guillemot_connect(struct gameport *gameport, struct gameport_driver * gameport_set_poll_handler(gameport, guillemot_poll); gameport_set_poll_interval(gameport, 20); - sprintf(guillemot->phys, "%s/input0", gameport->phys); + snprintf(guillemot->phys, sizeof(guillemot->phys), "%s/input0", gameport->phys); guillemot->type = guillemot_type + i; input_dev->name = guillemot_type[i].name; @@ -250,7 +250,9 @@ static int guillemot_connect(struct gameport *gameport, struct gameport_driver * for (i = 0; (t = guillemot->type->btn[i]) >= 0; i++) set_bit(t, input_dev->keybit); - input_register_device(guillemot->dev); + err = input_register_device(guillemot->dev); + if (err) + goto fail2; return 0;