diff options
author | Dave Airlie <airlied@redhat.com> | 2018-09-12 11:39:32 +1000 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2018-10-04 17:26:57 +0200 |
commit | cc4051ad6a3712c4407ffb608c8d23f2b66952d6 (patch) | |
tree | 2242e09b77a722e27b18f42b7f8b21ad667ea920 /dix/devices.c | |
parent | 64a7aac257ddbb000759d37386454866d8810545 (diff) |
devices: break after finding and removing device from lists
Coverity complains about a use after free in here after the
freeing, I can't follow the linked list so well, but whot
says the device can only be on one list once, so break should
fix it.
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit ba0f5d854f4db52974ab5cd09191303b01b075ff)
Diffstat (limited to 'dix/devices.c')
-rw-r--r-- | dix/devices.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/dix/devices.c b/dix/devices.c index 4a628afb0..1b18b168e 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -1177,6 +1177,7 @@ RemoveDevice(DeviceIntPtr dev, BOOL sendevent) flags[tmp->id] = IsMaster(tmp) ? XIMasterRemoved : XISlaveRemoved; CloseDevice(tmp); ret = Success; + break; } } @@ -1193,6 +1194,7 @@ RemoveDevice(DeviceIntPtr dev, BOOL sendevent) prev->next = next; ret = Success; + break; } } |