1
0
Fork 0
alistair23-linux/ipc
Gustavo A. R. Silva 4a2ae92993 ipc/sem.c: replace kvmalloc/memset with kvzalloc and use struct_size
Use kvzalloc() instead of kvmalloc() and memset().

Also, make use of the struct_size() helper instead of the open-coded
version in order to avoid any potential type mistakes.

This code was detected with the help of Coccinelle.

Link: http://lkml.kernel.org/r/20190131214221.GA28930@embeddedor
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-03-07 18:32:02 -08:00
..
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compat.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ipc_sysctl.c ipc: IPCMNI limit check for semmni 2018-10-31 08:54:14 -07:00
mq_sysctl.c ipc: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:16 -07:00
mqueue.c y2038: syscalls: rename y2038 compat syscalls 2019-02-07 00:13:27 +01:00
msg.c ipc: rename old-style shmctl/semctl/msgctl syscalls 2019-01-25 17:22:50 +01:00
msgutil.c ipc: convert ipc_namespace.count from atomic_t to refcount_t 2017-09-08 18:26:51 -07:00
namespace.c ipc: simplify ipc initialization 2018-08-22 10:52:52 -07:00
sem.c ipc/sem.c: replace kvmalloc/memset with kvzalloc and use struct_size 2019-03-07 18:32:02 -08:00
shm.c ipc: rename old-style shmctl/semctl/msgctl syscalls 2019-01-25 17:22:50 +01:00
syscall.c ipc: rename old-style shmctl/semctl/msgctl syscalls 2019-01-25 17:22:50 +01:00
util.c ipc/util.c: update return value of ipc_getref from int to bool 2018-08-22 10:52:52 -07:00
util.h ipc: rename old-style shmctl/semctl/msgctl syscalls 2019-01-25 17:22:50 +01:00