svn commit: r271457 - head/sys/dev/ahci

Alexander Motin mav at FreeBSD.org
Fri Sep 12 08:37:22 UTC 2014


Author: mav
Date: Fri Sep 12 08:37:21 2014
New Revision: 271457
URL: http://svnweb.freebsd.org/changeset/base/271457

Log:
  Initialize variables before resource_int_value().
  
  Submitted by:	Dmitry Luhtionov <dmitryluhtionov at gmail.com>

Modified:
  head/sys/dev/ahci/ahci.c

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Fri Sep 12 08:35:12 2014	(r271456)
+++ head/sys/dev/ahci/ahci.c	Fri Sep 12 08:37:21 2014	(r271457)
@@ -159,6 +159,7 @@ ahci_attach(device_t dev)
 	device_t child;
 
 	ctlr->dev = dev;
+	ctlr->ccc = 0;
 	resource_int_value(device_get_name(dev),
 	    device_get_unit(dev), "ccc", &ctlr->ccc);
 
@@ -624,6 +625,7 @@ ahci_ch_attach(device_t dev)
 	ch->subdeviceid = ctlr->subdeviceid;
 	ch->numslots = ((ch->caps & AHCI_CAP_NCS) >> AHCI_CAP_NCS_SHIFT) + 1;
 	mtx_init(&ch->mtx, "AHCI channel lock", NULL, MTX_DEF);
+	ch->pm_level = 0;
 	resource_int_value(device_get_name(dev),
 	    device_get_unit(dev), "pm_level", &ch->pm_level);
 	STAILQ_INIT(&ch->doneq);


More information about the svn-src-head mailing list