diff options
author | mux <mux@FreeBSD.org> | 2002-06-22 21:44:11 +0000 |
---|---|---|
committer | mux <mux@FreeBSD.org> | 2002-06-22 21:44:11 +0000 |
commit | df8395282d3bbecdd1df73bdd4ec5a26b6dee916 (patch) | |
tree | a19bf9bf9ad19902592b13cee7813ac9abb859c5 /sys | |
parent | 2730f1975dceaa864b310ade2c500c17696db4b4 (diff) | |
download | FreeBSD-src-df8395282d3bbecdd1df73bdd4ec5a26b6dee916.zip FreeBSD-src-df8395282d3bbecdd1df73bdd4ec5a26b6dee916.tar.gz |
We don't need to check the return value of malloc() against
NULL when the M_WAITOK flag is specified.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_init.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index f294aa0..b221cd3 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -187,8 +187,6 @@ vfs_opv_recalc(void) MALLOC(*opv_desc_vector_p, vop_t **, vfs_opv_numops * sizeof(vop_t *), M_VNODE, M_WAITOK | M_ZERO); - if (*opv_desc_vector_p == NULL) - panic("no memory for vop_t ** vector"); /* Fill in, with slot 0 being to return EOPNOTSUPP */ opv_desc_vector = *opv_desc_vector_p; @@ -224,8 +222,6 @@ vfs_add_vnodeops(const void *data) opv = (const struct vnodeopv_desc *)data; MALLOC(newopv, const struct vnodeopv_desc **, (vnodeopv_num + 1) * sizeof(*newopv), M_VNODE, M_WAITOK); - if (newopv == NULL) - panic("vfs_add_vnodeops: no memory"); if (vnodeopv_descs) { bcopy(vnodeopv_descs, newopv, vnodeopv_num * sizeof(*newopv)); FREE(vnodeopv_descs, M_VNODE); @@ -249,14 +245,10 @@ vfs_add_vnodeops(const void *data) MALLOC(newop, struct vnodeop_desc **, (num_op_descs + 1) * sizeof(*newop), M_VNODE, M_WAITOK); - if (newop == NULL) - panic("vfs_add_vnodeops: no memory for desc"); /* new reference count (for unload) */ MALLOC(newref, int *, (num_op_descs + 1) * sizeof(*newref), M_VNODE, M_WAITOK); - if (newref == NULL) - panic("vfs_add_vnodeops: no memory for refs"); if (vfs_op_descs) { bcopy(vfs_op_descs, newop, num_op_descs * sizeof(*newop)); @@ -315,14 +307,10 @@ vfs_rm_vnodeops(const void *data) MALLOC(newop, struct vnodeop_desc **, (num_op_descs - 1) * sizeof(*newop), M_VNODE, M_WAITOK); - if (newop == NULL) - panic("vfs_remove_vnodeops: no memory for desc"); /* new reference count (for unload) */ MALLOC(newref, int *, (num_op_descs - 1) * sizeof(*newref), M_VNODE, M_WAITOK); - if (newref == NULL) - panic("vfs_remove_vnodeops: no memory for refs"); for (k = j; k < (num_op_descs - 1); k++) { vfs_op_descs[k] = vfs_op_descs[k + 1]; vfs_op_desc_refs[k] = vfs_op_desc_refs[k + 1]; @@ -353,8 +341,6 @@ vfs_rm_vnodeops(const void *data) FREE(opv_desc_vector, M_VNODE); MALLOC(newopv, const struct vnodeopv_desc **, (vnodeopv_num - 1) * sizeof(*newopv), M_VNODE, M_WAITOK); - if (newopv == NULL) - panic("vfs_remove_vnodeops: no memory"); bcopy(vnodeopv_descs, newopv, (vnodeopv_num - 1) * sizeof(*newopv)); FREE(vnodeopv_descs, M_VNODE); vnodeopv_descs = newopv; |