diff options
author | mav <mav@FreeBSD.org> | 2015-10-05 07:36:16 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-10-05 07:36:16 +0000 |
commit | fece49cfcc0dfeb2749b38f68576fa7066938795 (patch) | |
tree | df6d4a5a71c7c0bdd60759a9c11f017deccf5a80 | |
parent | f3e1fd582ee826d78d5b027d832a2148470c5b85 (diff) | |
download | FreeBSD-src-fece49cfcc0dfeb2749b38f68576fa7066938795.zip FreeBSD-src-fece49cfcc0dfeb2749b38f68576fa7066938795.tar.gz |
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.
-rw-r--r-- | sys/cam/cam_xpt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 17b4f19..5c3c37d 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -4527,7 +4527,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++; @@ -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); |