author: Dan Carpenter <dan.carpenter@oracle.com> 2019-07-16 16:28:38 -0700
committer: Linus Torvalds <torvalds@linux-foundation.org> 2019-07-16 19:23:23 -0700
commit: 4dc48193d748f0f0fbe37105a905466ff3a6ad50
parent: 5e7c31dfe74703f428220384b2863525957cc160
Commit Summary:
Diffstat:
1 file changed, 5 insertions, 1 deletion
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c
index ac130d469a3e..f74296acc59e 100644
--- a/fs/coda/psdev.c
+++ b/fs/coda/psdev.c
@@ -123,7 +123,11 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf,
hdr.opcode, hdr.unique);
nbytes = size;
}
- CODA_ALLOC(dcbuf, union outputArgs *, nbytes);
+ dcbuf = kvmalloc(nbytes, GFP_KERNEL);
+ if (!dcbuf) {
+ retval = -ENOMEM;
+ goto out;
+ }
if (copy_from_user(dcbuf, buf, nbytes)) {
CODA_FREE(dcbuf, nbytes);
retval = -EFAULT;