diff options
author | cperciva <cperciva@FreeBSD.org> | 2004-02-22 01:06:05 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2004-02-22 01:06:05 +0000 |
commit | ae73820125a27c770a216c852d7a27d7018fe9a4 (patch) | |
tree | a8f9537d96117a2631afd6dda1bc03922f4fbd6d /sys/dev | |
parent | b5743daf691751f31c4c13910b083f04eb7be1d2 (diff) | |
download | FreeBSD-src-ae73820125a27c770a216c852d7a27d7018fe9a4.zip FreeBSD-src-ae73820125a27c770a216c852d7a27d7018fe9a4.tar.gz |
We want to allocate and zero sizeof(struct foo) bytes, not
sizeof(struct foo *) bytes.
Reported by: "Ted Unangst" <tedu@coverity.com>
Approved by: rwatson (mentor), scottl
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/raidframe/rf_diskqueue.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/raidframe/rf_diskqueue.c b/sys/dev/raidframe/rf_diskqueue.c index bb1f01a..c03e6cd 100644 --- a/sys/dev/raidframe/rf_diskqueue.c +++ b/sys/dev/raidframe/rf_diskqueue.c @@ -157,11 +157,11 @@ init_dqd(dqd) RF_DiskQueueData_t *dqd; { - dqd->bp = (RF_Buf_t) malloc(sizeof(RF_Buf_t), M_RAIDFRAME, M_NOWAIT); + dqd->bp = (RF_Buf_t) malloc(sizeof(*dqd->bp), M_RAIDFRAME, M_NOWAIT); if (dqd->bp == NULL) { return (ENOMEM); } - memset(dqd->bp, 0, sizeof(RF_Buf_t)); /* if you don't do it, nobody + memset(dqd->bp, 0, sizeof(*dqd->bp)); /* if you don't do it, nobody * else will.. */ return (0); } |