From f6235171882d18d0b4d11a3d564c6aa3b22af9d1 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Mon, 23 Nov 2015 21:37:51 +0000 Subject: [PATCH] pipe-loader: fix off-by one error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit With earlier commit we've dropped the manual iteration over the fixed size array and prepemtively set the variable storing the size, that is to be returned. Yet we forgot to adjust the comparison, as before we were comparing the index, now we're comparing the size. Fixes: ff9cd8a67ca "pipe-loader: directly use pipe_loader_sw_probe_null() at probe time" Cc: mesa-stable@lists.freedesktop.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93091 Reported-by: Tom Stellard Signed-off-by: Emil Velikov Tested-by: Tom Stellard Tested-by: Dieter Nützel --- src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c index 5539a730b4c..091d4d6997d 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c @@ -222,7 +222,7 @@ pipe_loader_sw_probe(struct pipe_loader_device **devs, int ndev) { int i = 1; - if (i < ndev) { + if (i <= ndev) { if (!pipe_loader_sw_probe_null(devs)) { i--; } -- 2.30.2