summaryrefslogtreecommitdiff
path: root/drivers/input/joystick/amijoy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/joystick/amijoy.c')
-rw-r--r--drivers/input/joystick/amijoy.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c
index 650acf3a30b7..e608691b5a61 100644
--- a/drivers/input/joystick/amijoy.c
+++ b/drivers/input/joystick/amijoy.c
@@ -147,7 +147,11 @@ static int __init amijoy_init(void)
amijoy_dev[i]->absmax[ABS_X + j] = 1;
}
- input_register_device(amijoy_dev[i]);
+ err = input_register_device(amijoy_dev[i]);
+ if (err) {
+ input_free_device(amijoy_dev[i]);
+ goto fail;
+ }
}
return 0;