diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2010-11-02 09:23:41 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-11-02 09:32:24 +1000 |
commit | b37d4636aed50d964dd625728905997751b2f24c (patch) | |
tree | 1526b1f0124db352a856ae0effc1c802848026ad | |
parent | 637f6fcc7ae0afca35289dceb6b9bbd5551dab0b (diff) |
Move allocation of mPriv down.
No functional change. If we get to this point, we know it's available.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/vmmouse.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/vmmouse.c b/src/vmmouse.c index 7f861eb..8645de6 100644 --- a/src/vmmouse.c +++ b/src/vmmouse.c @@ -268,15 +268,6 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags) } #endif - mPriv = calloc (1, sizeof (VMMousePrivRec)); - - - if (!mPriv) { - return NULL; - } - - mPriv->absoluteRequested = FALSE; - /* * try to enable vmmouse here */ @@ -286,13 +277,11 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags) * Fall back to normal mouse module */ xf86Msg(X_ERROR, "VMWARE(0): vmmouse enable failed\n"); - free(mPriv); return VMMouseInitPassthru(drv, dev, flags); } else { /* * vmmouse is available */ - mPriv->vmmouseAvailable = TRUE; xf86Msg(X_INFO, "VMWARE(0): vmmouse is available\n"); /* * Disable the absolute pointing device for now @@ -302,10 +291,19 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags) } if (!(pInfo = xf86AllocateInput(drv, 0))) { - free(mPriv); return NULL; } + mPriv = calloc (1, sizeof (VMMousePrivRec)); + + if (!mPriv) { + xf86DeleteInput(pInfo, 0); + return NULL; + } + + mPriv->absoluteRequested = FALSE; + mPriv->vmmouseAvailable = TRUE; + /* Settup the pInfo */ pInfo->name = dev->identifier; pInfo->type_name = XI_MOUSE; |