Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Sep 2014 08:37:21 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r271457 - head/sys/dev/ahci
Message-ID:  <201409120837.s8C8bL6s082247@svn.freebsd.org>

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



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