Instead of copying the I/O engine name, use a pointer to the I/O engine
name. This patch suppresses the following false positive Valgrind complaint:
Conditional jump or move depends on uninitialised value(s)
at 0x41D451: __load_ioengine (ioengines.c:133)
by 0x41D451: load_ioengine (ioengines.c:161)
by 0x41FA59: ioengine_load (init.c:1126)
by 0x423B64: parse_cmd_line (init.c:2670)
by 0x4241A3: parse_options (init.c:2965)
by 0x40F587: main (fio.c:42)
The code for copying I/O engine names was introduced by commit
2866c82d598e
("[PATCH] Separate io engines into separate loadable objects").
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
-static struct ioengine_ops *__load_ioengine(const char *name)
+static struct ioengine_ops *__load_ioengine(const char *engine)
- char engine[64];
-
- snprintf(engine, sizeof(engine), "%s", name);
-
/*
* linux libaio has alias names, so convert to what we want
*/
if (!strncmp(engine, "linuxaio", 8)) {
/*
* linux libaio has alias names, so convert to what we want
*/
if (!strncmp(engine, "linuxaio", 8)) {
- dprint(FD_IO, "converting ioengine name: %s -> libaio\n", name);
- strcpy(engine, "libaio");
+ dprint(FD_IO, "converting ioengine name: %s -> libaio\n",
+ engine);
+ engine = "libaio";
}
dprint(FD_IO, "load ioengine %s\n", engine);
}
dprint(FD_IO, "load ioengine %s\n", engine);