touchpad: check calloc result

Check the value returned by calloc.

Signed-off-by: Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Carlos Olmedo Escobar 2014-04-29 01:26:28 +02:00 committed by Peter Hutterer
parent aba28c0b73
commit 97af5c33a3

View file

@ -721,6 +721,8 @@ tp_init_slots(struct tp_dispatch *tp,
}
tp->touches = calloc(tp->ntouches,
sizeof(struct tp_touch));
if (!tp->touches)
return -1;
return 0;
}