Skip to content

Commit

Permalink
Input: amijoy - add missing platform check
Browse files Browse the repository at this point in the history
On multi-platform kernels, the Amiga joystick driver may be initialized
when running on Amiga only. Else it may crash later.
Fortunately this driver is almost always compiled as a module (to avoid
conflicts with the mouse driver), so it needs an explicit insmod to
trigger a crash.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Geert Uytterhoeven authored and Dmitry Torokhov committed Mar 26, 2012
1 parent a1d552c commit 3183968
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/input/joystick/amijoy.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ static int __init amijoy_init(void)
int i, j;
int err;

if (!MACH_IS_AMIGA)
return -ENODEV;

for (i = 0; i < 2; i++) {
if (!amijoy[i])
continue;
Expand Down

0 comments on commit 3183968

Please sign in to comment.