Makes it easier to initialise everything to the right values. Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> --- src/evdev.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/evdev.c b/src/evdev.c index 5667dc1..baa7ac1 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -2461,13 +2461,20 @@ EvdevUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) xf86DeleteInput(pInfo, flags); } +static EvdevPtr +EvdevAlloc(void) +{ + EvdevPtr pEvdev = calloc(sizeof(EvdevRec), 1); + return pEvdev; +} + static int EvdevPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) { EvdevPtr pEvdev; int rc = BadAlloc; - if (!(pEvdev = calloc(sizeof(EvdevRec), 1))) + if (!(pEvdev = EvdevAlloc())) goto error; pInfo->private = pEvdev; -- 1.8.1 _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel