[igt-dev] [PATCH i-g-t 21/21] lib/drmtest: Don't read from NULL in set_forced_driver
Petri Latvala
petri.latvala at intel.com
Wed Jan 16 11:20:50 UTC 2019
The only caller so far never passes NULL so no effects today.
Signed-off-by: Petri Latvala <petri.latvala at intel.com>
Cc: Rodrigo Siqueira <rodrigosiqueiramelo at gmail.com>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
---
lib/drmtest.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/drmtest.c b/lib/drmtest.c
index 7c124ac6..1964795a 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -134,8 +134,10 @@ static char _forced_driver[16] = "";
*/
void __set_forced_driver(const char *name)
{
- if (!name)
+ if (!name) {
igt_warn("No driver specified, keep default behaviour\n");
+ return;
+ }
strncpy(_forced_driver, name, sizeof(_forced_driver) - 1);
}
--
2.19.1
More information about the igt-dev
mailing list