usbWcmInit is called for each tool, only allocate the event data store once.

Signed-off-by: Peter Hutterer <[email protected]>
---
 src/wcmUSB.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index bd7b113..4c8fe94 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -532,9 +532,8 @@ static Bool usbWcmInit(LocalDevicePtr local, char* id, 
float *version)
        else
                common->nbuttons = 5;
 
-       common->private = calloc(1, sizeof(wcmUSBData));
-
-       if (!common->private)
+       if (!common->private &&
+           !(common->private = calloc(1, sizeof(wcmUSBData))))
        {
                xf86Msg(X_ERROR, "%s: unable to alloc event queue.\n",
                                        local->name);
-- 
1.7.0.1


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to