[Mesa-dev] [PATCH] anv: fix possible stack corruption
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Fri May 5 00:39:57 UTC 2017
Something funny happened with the indentation, if you could fix this,
this is :
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Thanks!
-
Lionel
On 04/05/17 17:34, Grazvydas Ignotas wrote:
> ping
> Emil: the code this fixes is yours.
>
> GraÅžvydas
>
> On Tue, May 2, 2017 at 8:17 PM, Grazvydas Ignotas <notasas at gmail.com
> <mailto:notasas at gmail.com>> wrote:
>
> drmGetDevices2 takes count and not size. Probably hasn't caused
> problems
> yet in practice and was missed as setups with more than 8 DRM devices
> are not very common.
>
> Fixes: b1fb6e8d "anv: do not open random render node(s)"
> Signed-off-by: Grazvydas Ignotas <notasas at gmail.com
> <mailto:notasas at gmail.com>>
> ---
> src/intel/vulkan/anv_device.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/intel/vulkan/anv_device.c
> b/src/intel/vulkan/anv_device.c
> index 6b3202d..78f133e 100644
> --- a/src/intel/vulkan/anv_device.c
> +++ b/src/intel/vulkan/anv_device.c
> @@ -492,11 +492,11 @@ anv_enumerate_devices(struct anv_instance
> *instance)
> VkResult result = VK_ERROR_INCOMPATIBLE_DRIVER;
> int max_devices;
>
> instance->physicalDeviceCount = 0;
>
> - max_devices = drmGetDevices2(0, devices, sizeof(devices));
> + max_devices = drmGetDevices2(0, devices, ARRAY_SIZE(devices));
> if (max_devices < 1)
> return VK_ERROR_INCOMPATIBLE_DRIVER;
>
> for (unsigned i = 0; i < (unsigned)max_devices; i++) {
> if (devices[i]->available_nodes & 1 << DRM_NODE_RENDER &&
> --
> 2.7.4
>
>
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170504/cde0977b/attachment.html>
More information about the mesa-dev
mailing list