Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Oct 2015 07:36:17 +0000 (UTC)
From:      Alexander Motin <mav@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: r288700 - stable/10/sys/cam
Message-ID:  <201510050736.t957aHr4080496@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Oct  5 07:36:16 2015
New Revision: 288700
URL: https://svnweb.freebsd.org/changeset/base/288700

Log:
  MFC r280388 (by benno): Be consistent with M_ZERO when allocating ccbs.
  
  There are four places, all in cam_xpt.c, where ccbs are malloc'ed. Two of
  these use M_ZERO, two don't. The two that don't meant that allocated ccbs
  had trash in them making it hard to debug errors where they showed up. Due
  to this, use M_ZERO all the time when allocating ccbs.

Modified:
  stable/10/sys/cam/cam_xpt.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/cam_xpt.c
==============================================================================
--- stable/10/sys/cam/cam_xpt.c	Mon Oct  5 07:33:54 2015	(r288699)
+++ stable/10/sys/cam/cam_xpt.c	Mon Oct  5 07:36:16 2015	(r288700)
@@ -4527,7 +4527,7 @@ xpt_get_ccb_nowait(struct cam_periph *pe
 {
 	union ccb *new_ccb;
 
-	new_ccb = malloc(sizeof(*new_ccb), M_CAMCCB, M_NOWAIT);
+	new_ccb = malloc(sizeof(*new_ccb), M_CAMCCB, M_ZERO|M_NOWAIT);
 	if (new_ccb == NULL)
 		return (NULL);
 	periph->periph_allocated++;
@@ -4541,7 +4541,7 @@ xpt_get_ccb(struct cam_periph *periph)
 	union ccb *new_ccb;
 
 	cam_periph_unlock(periph);
-	new_ccb = malloc(sizeof(*new_ccb), M_CAMCCB, M_WAITOK);
+	new_ccb = malloc(sizeof(*new_ccb), M_CAMCCB, M_ZERO|M_WAITOK);
 	cam_periph_lock(periph);
 	periph->periph_allocated++;
 	cam_ccbq_take_opening(&periph->path->device->ccbq);



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