Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102681355
D27333.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
901 B
Referenced Files
None
Subscribers
None
D27333.diff
View Options
diff --git a/lib/libcam/cam.3 b/lib/libcam/cam.3
--- a/lib/libcam/cam.3
+++ b/lib/libcam/cam.3
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 6, 2020
+.Dd November 23, 2020
.Dt CAM 3
.Os
.Sh NAME
@@ -285,9 +285,9 @@
structure was allocated by the caller, rather than the CAM library.
.Pp
.Fn cam_getccb
-allocates a CCB
+allocates a prezeroed CCB
using
-.Xr malloc 3
+.Xr calloc 3
and sets fields in the CCB header using values from the
.Va cam_device
structure.
diff --git a/lib/libcam/camlib.c b/lib/libcam/camlib.c
--- a/lib/libcam/camlib.c
+++ b/lib/libcam/camlib.c
@@ -79,9 +79,8 @@
{
union ccb *ccb;
- ccb = (union ccb *)malloc(sizeof(union ccb));
+ ccb = calloc(1, sizeof(*ccb));
if (ccb != NULL) {
- bzero(&ccb->ccb_h, sizeof(struct ccb_hdr));
ccb->ccb_h.path_id = dev->path_id;
ccb->ccb_h.target_id = dev->target_id;
ccb->ccb_h.target_lun = dev->target_lun;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 7:14 PM (21 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14663308
Default Alt Text
D27333.diff (901 B)
Attached To
Mode
D27333: Make cam_getccb(3) zero the whole ccb, not just the header
Attached
Detach File
Event Timeline
Log In to Comment