From 6486ccfe2fa37443648eba600b20c42a73df45e8 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Fri, 10 Jan 2020 22:20:23 +0000 Subject: [PATCH] camdd: initialize devs earlier GCC9 points out that devs may be used initialized after the bailout label; in-fact, if num_io_opts != 2 then it is. Move the initialization up a little bit. Reviewed by: ken MFC after: 3 days --- usr.sbin/camdd/camdd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/camdd/camdd.c b/usr.sbin/camdd/camdd.c index b3d56c659d1d..caf06ba9a596 100644 --- a/usr.sbin/camdd/camdd.c +++ b/usr.sbin/camdd/camdd.c @@ -3226,14 +3226,14 @@ camdd_rw(struct camdd_io_opts *io_opts, int num_io_opts, uint64_t max_io, int error = 0; int i; + bzero(devs, sizeof(devs)); + if (num_io_opts != 2) { warnx("Must have one input and one output path"); error = 1; goto bailout; } - bzero(devs, sizeof(devs)); - for (i = 0; i < num_io_opts; i++) { switch (io_opts[i].dev_type) { case CAMDD_DEV_PASS: {