Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jul 2015 14:25:21 +0000 (UTC)
From:      Christian Brueffer <brueffer@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r285748 - in stable/10/sbin/ggate: ggatec ggatel
Message-ID:  <201507211425.t6LEPLKC089562@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brueffer
Date: Tue Jul 21 14:25:21 2015
New Revision: 285748
URL: https://svnweb.freebsd.org/changeset/base/285748

Log:
  MFC: r285531
  
  Unbreak ggatec and ggatel on i386 after r238119, which added two more
  'struct g_gate_ctl_create' fields.
  
  While the behaviour was technically undefined on other architectures
  as well, on the reporter's amd64 systems the uninitialized bytes the
  kernel cares about were always zero so everything worked as expected.
  
  PR:		197309, 199559
  Submitted by:	ota@j.email.ne.jp, Fabian Keil
  Reviewed by:	pjd
  Approved by:	re (gjb)

Modified:
  stable/10/sbin/ggate/ggatec/ggatec.c
  stable/10/sbin/ggate/ggatel/ggatel.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/ggate/ggatec/ggatec.c
==============================================================================
--- stable/10/sbin/ggate/ggatec/ggatec.c	Tue Jul 21 13:25:56 2015	(r285747)
+++ stable/10/sbin/ggate/ggatec/ggatec.c	Tue Jul 21 14:25:21 2015	(r285748)
@@ -447,6 +447,7 @@ g_gatec_create(void)
 	/*
 	 * Ok, got both sockets, time to create provider.
 	 */
+	memset(&ggioc, 0, sizeof(ggioc));
 	ggioc.gctl_version = G_GATE_VERSION;
 	ggioc.gctl_mediasize = mediasize;
 	ggioc.gctl_sectorsize = sectorsize;

Modified: stable/10/sbin/ggate/ggatel/ggatel.c
==============================================================================
--- stable/10/sbin/ggate/ggatel/ggatel.c	Tue Jul 21 13:25:56 2015	(r285747)
+++ stable/10/sbin/ggate/ggatel/ggatel.c	Tue Jul 21 14:25:21 2015	(r285748)
@@ -173,6 +173,7 @@ g_gatel_create(void)
 	fd = open(path, g_gate_openflags(flags) | O_DIRECT | O_FSYNC);
 	if (fd == -1)
 		err(EXIT_FAILURE, "Cannot open %s", path);
+	memset(&ggioc, 0, sizeof(ggioc));
 	ggioc.gctl_version = G_GATE_VERSION;
 	ggioc.gctl_unit = unit;
 	ggioc.gctl_mediasize = g_gate_mediasize(fd);



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