mirror of
https://github.com/X11Libre/xf86-input-vmmouse.git
synced 2026-03-24 01:34:05 +00:00
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> Acked-by: Thomas Hellstrom <thellstrom@vmware.com>
This commit is contained in:
committed by
Thomas Hellstrom
parent
4e08974ead
commit
3d97fa1c3a
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user