FreeBSD Bugzilla – Attachment 11228 Details for
Bug 22186
Patch to sys/cam to add M_ZERO to appropriate malloc calls
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.30 KB, created by
josh
on 2000-10-21 15:10:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
josh
Created:
2000-10-21 15:10:01 UTC
Size:
3.30 KB
patch
obsolete
>Index: scsi/scsi_cd.c >=================================================================== >RCS file: /usr/home/ncvs/src/sys/cam/scsi/scsi_cd.c,v >retrieving revision 1.39 >diff -u -r1.39 scsi_cd.c >--- scsi/scsi_cd.c 2000/05/26 02:01:48 1.39 >+++ scsi/scsi_cd.c 2000/10/21 14:00:44 >@@ -3026,8 +3026,7 @@ > } > > if (length != 0) { >- databuf = malloc(length, M_DEVBUF, M_WAITOK); >- bzero(databuf, length); >+ databuf = malloc(length, M_DEVBUF, M_WAITOK | M_ZERO); > } else > databuf = NULL; > >@@ -3158,12 +3157,10 @@ > > length = sizeof(*challenge_data); > >- challenge_data = malloc(length, M_DEVBUF, M_WAITOK); >+ challenge_data = malloc(length, M_DEVBUF, M_WAITOK | M_ZERO); > > databuf = (u_int8_t *)challenge_data; > >- bzero(databuf, length); >- > scsi_ulto2b(length - sizeof(challenge_data->data_len), > challenge_data->data_len); > >@@ -3177,12 +3174,10 @@ > > length = sizeof(*key2_data); > >- key2_data = malloc(length, M_DEVBUF, M_WAITOK); >+ key2_data = malloc(length, M_DEVBUF, M_WAITOK | M_ZERO); > > databuf = (u_int8_t *)key2_data; > >- bzero(databuf, length); >- > scsi_ulto2b(length - sizeof(key2_data->data_len), > key2_data->data_len); > >@@ -3196,12 +3191,10 @@ > > length = sizeof(*rpc_data); > >- rpc_data = malloc(length, M_DEVBUF, M_WAITOK); >+ rpc_data = malloc(length, M_DEVBUF, M_WAITOK | M_ZERO); > > databuf = (u_int8_t *)rpc_data; > >- bzero(databuf, length); >- > scsi_ulto2b(length - sizeof(rpc_data->data_len), > rpc_data->data_len); > >@@ -3343,8 +3336,7 @@ > } > > if (length != 0) { >- databuf = malloc(length, M_DEVBUF, M_WAITOK); >- bzero(databuf, length); >+ databuf = malloc(length, M_DEVBUF, M_WAITOK | M_ZERO); > } else > databuf = NULL; > >Index: scsi/scsi_ch.c >=================================================================== >RCS file: /usr/home/ncvs/src/sys/cam/scsi/scsi_ch.c,v >retrieving revision 1.22 >diff -u -r1.22 scsi_ch.c >--- scsi/scsi_ch.c 2000/04/18 15:14:52 1.22 >+++ scsi/scsi_ch.c 2000/10/21 14:01:13 >@@ -1192,8 +1192,7 @@ > > user_data = (struct changer_element_status *) > malloc(avail * sizeof(struct changer_element_status), >- M_DEVBUF, M_WAITOK); >- bzero(user_data, avail * sizeof(struct changer_element_status)); >+ M_DEVBUF, M_WAITOK | M_ZERO); > > desc = (struct read_element_status_descriptor *)((uintptr_t)data + > sizeof(struct read_element_status_header) + >Index: scsi/scsi_sa.c >=================================================================== >RCS file: /usr/home/ncvs/src/sys/cam/scsi/scsi_sa.c,v >retrieving revision 1.57 >diff -u -r1.57 scsi_sa.c >--- scsi/scsi_sa.c 2000/10/05 17:02:20 1.57 >+++ scsi/scsi_sa.c 2000/10/21 14:01:56 >@@ -2392,8 +2392,7 @@ > mode_buffer_len += sizeof (sa_comp_t); > } > >- mode_buffer = malloc(mode_buffer_len, M_TEMP, M_WAITOK); >- bzero(mode_buffer, mode_buffer_len); >+ mode_buffer = malloc(mode_buffer_len, M_TEMP, M_WAITOK | M_ZERO); > mode_hdr = (struct scsi_mode_header_6 *)mode_buffer; > mode_blk = (struct scsi_mode_blk_desc *)&mode_hdr[1]; > >@@ -2595,8 +2594,7 @@ > if (params_to_set & SA_PARAM_COMPRESSION) > mode_buffer_len += sizeof (sa_comp_t); > >- mode_buffer = malloc(mode_buffer_len, M_TEMP, M_WAITOK); >- bzero(mode_buffer, mode_buffer_len); >+ mode_buffer = malloc(mode_buffer_len, M_TEMP, M_WAITOK | M_ZERO); > > mode_hdr = (struct scsi_mode_header_6 *)mode_buffer; > mode_blk = (struct scsi_mode_blk_desc *)&mode_hdr[1];
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 22186
: 11228