Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Jan 2020 18:22:51 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r356692 - in stable: 11/usr.sbin/camdd 12/usr.sbin/camdd
Message-ID:  <202001131822.00DIMprF016284@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001131822.00DIMprF016284>