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
This commit is contained in:
Kyle Evans 2020-01-10 22:20:23 +00:00
parent 0ce9d0af5b
commit 6486ccfe2f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=356617

View file

@ -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: {