Re: [PATCH libdrm 2/2] xf86drm: Handle unrecognized subsystems safely in drmGetDevice[s]()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 16, 2015 at 6:11 PM, Matt Roper <matthew.d.roper@xxxxxxxxx> wrote:
> Both drmGetDevice() and drmGetDevices() currently print a warning when
> they encounter an unknown (non-PCI) subsystem type for a device node,
> but they still proceed to assume that the drmDevicePtr was initialized
> and try to add it to the local device array.  Add a 'continue' to the
> error case handling to bypass the rest of the processing for devices we
> can't handle.
>
> Cc: Emil Velikov <emil.l.velikov@xxxxxxxxx>
> Signed-off-by: Matt Roper <matthew.d.roper@xxxxxxxxx>

Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>

> ---
>  xf86drm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/xf86drm.c b/xf86drm.c
> index 951edbb..7e28b4f 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -3140,7 +3140,7 @@ int drmGetDevice(int fd, drmDevicePtr *device)
>              break;
>          default:
>              fprintf(stderr, "The subsystem type is not supported yet\n");
> -            break;
> +            continue;
>          }
>
>          if (i >= max_count) {
> @@ -3244,7 +3244,7 @@ int drmGetDevices(drmDevicePtr devices[], int max_devices)
>              break;
>          default:
>              fprintf(stderr, "The subsystem type is not supported yet\n");
> -            break;
> +            continue;
>          }
>
>          if (i >= max_count) {
> --
> 2.1.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux