mirror of
https://github.com/X11Libre/xf86-input-mouse.git
synced 2026-03-24 01:24:06 +00:00
sun_mouse: remove entry from vuidMouseList in DEVICE_CLOSE
Originally written by fei.feng@oracle.com to fix Oracle Bug 17429216: "global vuidMouseList should not keep info for removed mouse device" "During the testing for bug#17251473, I often see the mouse hang in X. By debugging, I get that there seems something wrong in mouse_drv.so - when a mouse is disconnected, the global vuidMouseList does not cleanup the mouse's recorded info. So if a newly inserted mouse allocates a input info pInfo which happens to have the same memory address as previous pInfo, the driver would go wrong." Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
@@ -742,8 +742,21 @@ vuidMouseProc(DeviceIntPtr pPointer, int what)
|
||||
}
|
||||
break;
|
||||
|
||||
case DEVICE_OFF:
|
||||
case DEVICE_CLOSE:
|
||||
if (vuidMouseList == pVuidMse)
|
||||
vuidMouseList = vuidMouseList->next;
|
||||
else {
|
||||
VuidMsePtr m = vuidMouseList;
|
||||
|
||||
while ((m != NULL) && (m->next != pVuidMse)) {
|
||||
m = m->next;
|
||||
}
|
||||
|
||||
if (m != NULL)
|
||||
m->next = pVuidMse->next;
|
||||
}
|
||||
/* fallthrough */
|
||||
case DEVICE_OFF:
|
||||
if (pInfo->fd != -1) {
|
||||
if (pVuidMse->strmod) {
|
||||
SYSCALL(i = ioctl(pInfo->fd, I_POP, pVuidMse->strmod));
|
||||
|
||||
Reference in New Issue
Block a user