[PATCH] devices: break after finding and removing device from lists

Walter Harms wharms at bfs.de
Wed Sep 12 13:39:56 UTC 2018



> Dave Airlie <airlied at gmail.com> hat am 12. September 2018 um 03:40
> geschrieben:
> 
> 
> From: Dave Airlie <airlied at redhat.com>
> 
> 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 at redhat.com>

Is a list of Coverity complains some where online available ?

re,
 wh

> ---
>  dix/devices.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> 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;
>          }
>      }
>  
> -- 
> 2.17.1
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list