svn commit: r356617 - head/usr.sbin/camdd
Kyle Evans
kevans at FreeBSD.org
Fri Jan 10 22:20:24 UTC 2020
Author: kevans
Date: Fri Jan 10 22:20:23 2020
New Revision: 356617
URL: https://svnweb.freebsd.org/changeset/base/356617
Log:
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
Modified:
head/usr.sbin/camdd/camdd.c
Modified: head/usr.sbin/camdd/camdd.c
==============================================================================
--- head/usr.sbin/camdd/camdd.c Fri Jan 10 22:10:01 2020 (r356616)
+++ head/usr.sbin/camdd/camdd.c Fri Jan 10 22:20:23 2020 (r356617)
@@ -3226,13 +3226,13 @@ camdd_rw(struct camdd_io_opts *io_opts, int num_io_opt
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) {
More information about the svn-src-all
mailing list