Page MenuHomeFreeBSD

D30702.id90654.diff
No OneTemporary

D30702.id90654.diff

Index: sys/netpfil/pf/pf_ioctl.c
===================================================================
--- sys/netpfil/pf/pf_ioctl.c
+++ sys/netpfil/pf/pf_ioctl.c
@@ -3772,11 +3772,7 @@
totlen = io->pfrio_size * sizeof(struct pfr_table);
pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table),
- M_TEMP, M_NOWAIT);
- if (pfrts == NULL) {
- error = ENOMEM;
- break;
- }
+ M_TEMP, M_WAITOK);
error = copyin(io->pfrio_buffer, pfrts, totlen);
if (error) {
free(pfrts, M_TEMP);
@@ -3861,11 +3857,7 @@
}
totlen = io->pfrio_size * sizeof(struct pfr_addr);
pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr),
- M_TEMP, M_NOWAIT);
- if (! pfras) {
- error = ENOMEM;
- break;
- }
+ M_TEMP, M_WAITOK);
error = copyin(io->pfrio_buffer, pfras, totlen);
if (error) {
free(pfras, M_TEMP);
@@ -3899,11 +3891,7 @@
}
totlen = io->pfrio_size * sizeof(struct pfr_addr);
pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr),
- M_TEMP, M_NOWAIT);
- if (! pfras) {
- error = ENOMEM;
- break;
- }
+ M_TEMP, M_WAITOK);
error = copyin(io->pfrio_buffer, pfras, totlen);
if (error) {
free(pfras, M_TEMP);
@@ -3941,11 +3929,7 @@
}
totlen = count * sizeof(struct pfr_addr);
pfras = mallocarray(count, sizeof(struct pfr_addr), M_TEMP,
- M_NOWAIT);
- if (! pfras) {
- error = ENOMEM;
- break;
- }
+ M_WAITOK);
error = copyin(io->pfrio_buffer, pfras, totlen);
if (error) {
free(pfras, M_TEMP);
@@ -3980,11 +3964,7 @@
}
totlen = io->pfrio_size * sizeof(struct pfr_addr);
pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr),
- M_TEMP, M_NOWAIT);
- if (! pfras) {
- error = ENOMEM;
- break;
- }
+ M_TEMP, M_WAITOK);
PF_RULES_RLOCK();
error = pfr_get_addrs(&io->pfrio_table, pfras,
&io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL);
@@ -4012,11 +3992,7 @@
}
totlen = io->pfrio_size * sizeof(struct pfr_astats);
pfrastats = mallocarray(io->pfrio_size,
- sizeof(struct pfr_astats), M_TEMP, M_NOWAIT);
- if (! pfrastats) {
- error = ENOMEM;
- break;
- }
+ sizeof(struct pfr_astats), M_TEMP, M_WAITOK);
PF_RULES_RLOCK();
error = pfr_get_astats(&io->pfrio_table, pfrastats,
&io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL);
@@ -4044,11 +4020,7 @@
}
totlen = io->pfrio_size * sizeof(struct pfr_addr);
pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr),
- M_TEMP, M_NOWAIT);
- if (! pfras) {
- error = ENOMEM;
- break;
- }
+ M_TEMP, M_WAITOK);
error = copyin(io->pfrio_buffer, pfras, totlen);
if (error) {
free(pfras, M_TEMP);
@@ -4082,11 +4054,7 @@
}
totlen = io->pfrio_size * sizeof(struct pfr_addr);
pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr),
- M_TEMP, M_NOWAIT);
- if (! pfras) {
- error = ENOMEM;
- break;
- }
+ M_TEMP, M_WAITOK);
error = copyin(io->pfrio_buffer, pfras, totlen);
if (error) {
free(pfras, M_TEMP);
@@ -4120,11 +4088,7 @@
}
totlen = io->pfrio_size * sizeof(struct pfr_addr);
pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr),
- M_TEMP, M_NOWAIT);
- if (! pfras) {
- error = ENOMEM;
- break;
- }
+ M_TEMP, M_WAITOK);
error = copyin(io->pfrio_buffer, pfras, totlen);
if (error) {
free(pfras, M_TEMP);
@@ -4173,11 +4137,7 @@
}
totlen = sizeof(struct pfioc_trans_e) * io->size;
ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e),
- M_TEMP, M_NOWAIT);
- if (! ioes) {
- error = ENOMEM;
- break;
- }
+ M_TEMP, M_WAITOK);
error = copyin(io->array, ioes, totlen);
if (error) {
free(ioes, M_TEMP);
@@ -4250,11 +4210,7 @@
}
totlen = sizeof(struct pfioc_trans_e) * io->size;
ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e),
- M_TEMP, M_NOWAIT);
- if (! ioes) {
- error = ENOMEM;
- break;
- }
+ M_TEMP, M_WAITOK);
error = copyin(io->array, ioes, totlen);
if (error) {
free(ioes, M_TEMP);
@@ -4329,11 +4285,7 @@
totlen = sizeof(struct pfioc_trans_e) * io->size;
ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e),
- M_TEMP, M_NOWAIT);
- if (ioes == NULL) {
- error = ENOMEM;
- break;
- }
+ M_TEMP, M_WAITOK);
error = copyin(io->array, ioes, totlen);
if (error) {
free(ioes, M_TEMP);
@@ -4536,11 +4488,7 @@
bufsiz = io->pfiio_size * sizeof(struct pfi_kif);
ifstore = mallocarray(io->pfiio_size, sizeof(struct pfi_kif),
- M_TEMP, M_NOWAIT);
- if (ifstore == NULL) {
- error = ENOMEM;
- break;
- }
+ M_TEMP, M_WAITOK);
PF_RULES_RLOCK();
pfi_get_ifaces(io->pfiio_name, ifstore, &io->pfiio_size);

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 15, 10:06 PM (20 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15420293
Default Alt Text
D30702.id90654.diff (4 KB)

Event Timeline