Date: Mon, 23 Mar 2015 18:45:38 +0000 (UTC) From: Benno Rice <benno@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280388 - head/sys/cam Message-ID: <201503231845.t2NIjcZ0032841@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: benno Date: Mon Mar 23 18:45:37 2015 New Revision: 280388 URL: https://svnweb.freebsd.org/changeset/base/280388 Log: 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 Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Mar 23 18:45:29 2015 (r280387) +++ head/sys/cam/cam_xpt.c Mon Mar 23 18:45:37 2015 (r280388) @@ -4523,7 +4523,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++; @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503231845.t2NIjcZ0032841>