aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Roper2015-10-16 17:11:24 -0500
committerEmil Velikov2015-10-20 12:45:23 -0500
commitba5a6ecf81fc2e25a4c7b8c592143faadfdd63db (patch)
treea322dcb35f1de1ea1a8bf52130d1e60f8798ddd8 /xf86drm.c
parentcf0f036e3d819fb7894562bfdfea95e5e5f57219 (diff)
downloadexternal-libdrm-ba5a6ecf81fc2e25a4c7b8c592143faadfdd63db.tar.gz
external-libdrm-ba5a6ecf81fc2e25a4c7b8c592143faadfdd63db.tar.xz
external-libdrm-ba5a6ecf81fc2e25a4c7b8c592143faadfdd63db.zip
xf86drm: Handle unrecognized subsystems safely in drmGetDevice[s]()
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. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'xf86drm.c')
-rw-r--r--xf86drm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xf86drm.c b/xf86drm.c
index 951edbb7..7e28b4f7 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -3140,7 +3140,7 @@ int drmGetDevice(int fd, drmDevicePtr *device)
3140 break; 3140 break;
3141 default: 3141 default:
3142 fprintf(stderr, "The subsystem type is not supported yet\n"); 3142 fprintf(stderr, "The subsystem type is not supported yet\n");
3143 break; 3143 continue;
3144 } 3144 }
3145 3145
3146 if (i >= max_count) { 3146 if (i >= max_count) {
@@ -3244,7 +3244,7 @@ int drmGetDevices(drmDevicePtr devices[], int max_devices)
3244 break; 3244 break;
3245 default: 3245 default:
3246 fprintf(stderr, "The subsystem type is not supported yet\n"); 3246 fprintf(stderr, "The subsystem type is not supported yet\n");
3247 break; 3247 continue;
3248 } 3248 }
3249 3249
3250 if (i >= max_count) { 3250 if (i >= max_count) {