Date: Fri, 10 Jan 2020 22:20:24 +0000 (UTC) From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356617 - head/usr.sbin/camdd Message-ID: <202001102220.00AMKOh7094966@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001102220.00AMKOh7094966>