Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci zero out struct i2cbus_attach_args and i2c_contr...



details:   https://anonhg.NetBSD.org/src/rev/3b7b8cde97af
branches:  trunk
changeset: 342619:3b7b8cde97af
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri Jan 01 20:48:15 2016 +0000

description:
zero out struct i2cbus_attach_args and i2c_controller before messing with
them

diffstat:

 sys/dev/pci/voyager.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r d7a27ceff859 -r 3b7b8cde97af sys/dev/pci/voyager.c
--- a/sys/dev/pci/voyager.c     Fri Jan 01 20:13:50 2016 +0000
+++ b/sys/dev/pci/voyager.c     Fri Jan 01 20:48:15 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: voyager.c,v 1.10 2014/03/29 19:28:25 christos Exp $    */
+/*     $NetBSD: voyager.c,v 1.11 2016/01/01 20:48:15 macallan Exp $    */
 
 /*
  * Copyright (c) 2009, 2011 Michael Lorenz
@@ -26,7 +26,7 @@
  */
  
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: voyager.c,v 1.10 2014/03/29 19:28:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: voyager.c,v 1.11 2016/01/01 20:48:15 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -244,6 +244,8 @@
                voyager_gpio_dir(sc, 0xffffffff, GPIO_I2C_BITS);
                
                /* Fill in the i2c tag */
+               memset(&sc->sc_i2c, 0, sizeof(sc->sc_i2c));
+               memset(&iba, 0, sizeof(iba));
                sc->sc_i2c.ic_cookie = sc;
                sc->sc_i2c.ic_acquire_bus = voyager_i2c_acquire_bus;
                sc->sc_i2c.ic_release_bus = voyager_i2c_release_bus;



Home | Main Index | Thread Index | Old Index