summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authorbenno <benno@FreeBSD.org>2015-03-23 18:45:37 +0000
committerbenno <benno@FreeBSD.org>2015-03-23 18:45:37 +0000
commit693d9444a3512c16bd74236968d00960239b60d8 (patch)
tree8edd3df0dd1dbdb615af5a507bf17d7e6d762219 /sys/cam
parent6b0fe693469966c554c8c8992b14ab5fde8da9a1 (diff)
downloadFreeBSD-src-693d9444a3512c16bd74236968d00960239b60d8.zip
FreeBSD-src-693d9444a3512c16bd74236968d00960239b60d8.tar.gz
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. Submitted by: Scott Ferris <scott.ferris@isilon.com> Sponsored by: EMC/Isilon Storage Division Reviewed by: scottl, imp Differential: https://reviews.freebsd.org/D2120
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/cam_xpt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index c8a9c37..06e01fc 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -4523,7 +4523,7 @@ xpt_get_ccb_nowait(struct cam_periph *periph)
{
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++;
@@ -4537,7 +4537,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);
OpenPOWER on IntegriCloud