diff options
Diffstat (limited to 'fs/coda/psdev.c')
-rw-r--r-- | fs/coda/psdev.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index 241f7e04ad04..b4da2812499e 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c | |||
@@ -100,8 +100,12 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf, | |||
100 | ssize_t retval = 0, count = 0; | 100 | ssize_t retval = 0, count = 0; |
101 | int error; | 101 | int error; |
102 | 102 | ||
103 | /* make sure there is enough to copy out the (opcode, unique) values */ | ||
104 | if (nbytes < (2 * sizeof(u_int32_t))) | ||
105 | return -EINVAL; | ||
106 | |||
103 | /* Peek at the opcode, uniquefier */ | 107 | /* Peek at the opcode, uniquefier */ |
104 | if (copy_from_user(&hdr, buf, 2 * sizeof(u_long))) | 108 | if (copy_from_user(&hdr, buf, 2 * sizeof(u_int32_t))) |
105 | return -EFAULT; | 109 | return -EFAULT; |
106 | 110 | ||
107 | if (DOWNCALL(hdr.opcode)) { | 111 | if (DOWNCALL(hdr.opcode)) { |
@@ -127,7 +131,7 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf, | |||
127 | } | 131 | } |
128 | 132 | ||
129 | /* what downcall errors does Venus handle ? */ | 133 | /* what downcall errors does Venus handle ? */ |
130 | error = coda_downcall(vcp, hdr.opcode, dcbuf); | 134 | error = coda_downcall(vcp, hdr.opcode, dcbuf, nbytes); |
131 | 135 | ||
132 | CODA_FREE(dcbuf, nbytes); | 136 | CODA_FREE(dcbuf, nbytes); |
133 | if (error) { | 137 | if (error) { |