diff --git a/sys/geom/geom.h b/sys/geom/geom.h index b261693..1cd5ba0 100644 --- a/sys/geom/geom.h +++ b/sys/geom/geom.h @@ -347,7 +347,7 @@ struct g_kerneldump { MALLOC_DECLARE(M_GEOM); static __inline void * -g_malloc(int size, int flags) +g_malloc(size_t size, int flags) { void *p; diff --git a/sys/geom/geom_ctl.c b/sys/geom/geom_ctl.c index 71a8c26..ff3f0f6 100644 --- a/sys/geom/geom_ctl.c +++ b/sys/geom/geom_ctl.c @@ -122,7 +122,10 @@ geom_alloc_copyin(struct gctl_req *req, void *uaddr, size_t len) { void *ptr; - ptr = g_malloc(len, M_WAITOK); + ptr = g_malloc(len, M_NOWAIT); + if (ptr==NULL) + return (NULL); + req->nerror = copyin(uaddr, ptr, len); if (!req->nerror) return (ptr);