Merge branch 'afs-proc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[muen/linux.git] / fs / afs / cmservice.c
index 5894101cdd9a0737f83e3f3a2d83ddec4db7c755..9e51d6fe7e8f975f34f877217a28a8e99bcfa5e4 100644 (file)
@@ -191,7 +191,8 @@ static int afs_deliver_cb_callback(struct afs_call *call)
                if (call->count > AFSCBMAX)
                        return afs_protocol_error(call, -EBADMSG);
 
-               call->buffer = kmalloc(call->count * 3 * 4, GFP_KERNEL);
+               call->buffer = kmalloc(array3_size(call->count, 3, 4),
+                                      GFP_KERNEL);
                if (!call->buffer)
                        return -ENOMEM;
                call->offset = 0;
@@ -330,7 +331,7 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call)
        switch (call->unmarshall) {
        case 0:
                call->offset = 0;
-               call->buffer = kmalloc(11 * sizeof(__be32), GFP_KERNEL);
+               call->buffer = kmalloc_array(11, sizeof(__be32), GFP_KERNEL);
                if (!call->buffer)
                        return -ENOMEM;
                call->unmarshall++;
@@ -453,7 +454,7 @@ static int afs_deliver_cb_probe_uuid(struct afs_call *call)
        switch (call->unmarshall) {
        case 0:
                call->offset = 0;
-               call->buffer = kmalloc(11 * sizeof(__be32), GFP_KERNEL);
+               call->buffer = kmalloc_array(11, sizeof(__be32), GFP_KERNEL);
                if (!call->buffer)
                        return -ENOMEM;
                call->unmarshall++;