diff options
author | Sylvestre Gallon <syl@cvs.openbsd.org> | 2013-10-07 18:09:59 +0000 |
---|---|---|
committer | Sylvestre Gallon <syl@cvs.openbsd.org> | 2013-10-07 18:09:59 +0000 |
commit | 61017cb60447cfb491985dd6f0f488c227114f64 (patch) | |
tree | cf7750c0bbd586c369e22f9e3fd5a39e1388830d /sys/miscfs | |
parent | c761051e93461f572bb3b826d5a941f53a75550a (diff) |
Allocate fb_dat in fb_setup(9)
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/fuse/fusebuf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/miscfs/fuse/fusebuf.c b/sys/miscfs/fuse/fusebuf.c index 4c9aae7b6e7..c387cfdaa12 100644 --- a/sys/miscfs/fuse/fusebuf.c +++ b/sys/miscfs/fuse/fusebuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fusebuf.c,v 1.3 2013/10/07 18:04:53 syl Exp $ */ +/* $OpenBSD: fusebuf.c,v 1.4 2013/10/07 18:09:58 syl Exp $ */ /* * Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com> * @@ -41,6 +41,11 @@ fb_setup(size_t len, ino_t ino, int op, struct proc *p) fbuf->fb_uuid = arc4random(); fbuf->fb_type = op; fbuf->fb_ino = ino; + if (len == 0) + fbuf->fb_dat = NULL; + else + fbuf->fb_dat = (uint8_t *)malloc(len, M_FUSEFS, + M_WAITOK | M_ZERO); return (fbuf); } |