svn commit: r356692 - in stable: 11/usr.sbin/camdd 12/usr.sbin/camdd

Kyle Evans kevans at FreeBSD.org
Mon Jan 13 18:22:52 UTC 2020


Author: kevans
Date: Mon Jan 13 18:22:51 2020
New Revision: 356692
URL: https://svnweb.freebsd.org/changeset/base/356692

Log:
  MFC r356617: 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.

Modified:
  stable/11/usr.sbin/camdd/camdd.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/usr.sbin/camdd/camdd.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/usr.sbin/camdd/camdd.c
==============================================================================
--- stable/11/usr.sbin/camdd/camdd.c	Mon Jan 13 18:20:04 2020	(r356691)
+++ stable/11/usr.sbin/camdd/camdd.c	Mon Jan 13 18:22:51 2020	(r356692)
@@ -2984,13 +2984,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