From d96d0f9617793b6cd95b9b9a8fef66f69f8f6b1b Mon Sep 17 00:00:00 2001 From: Paulo Miguel Almeida Date: Wed, 12 Oct 2022 09:23:14 +1300 Subject: dlm: replace one-element array with fixed size array One-element arrays are deprecated. So, replace one-element array with fixed size array member in struct dlm_ls, and refactor the rest of the code, accordingly. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/228 Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836 Link: https://lore.kernel.org/lkml/Y0W5jkiXUkpNl4ap@mail.google.com/ Signed-off-by: Paulo Miguel Almeida Reviewed-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: David Teigland --- fs/dlm/lockspace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/dlm/lockspace.c') diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c index bae050df7abf..9479c8110979 100644 --- a/fs/dlm/lockspace.c +++ b/fs/dlm/lockspace.c @@ -473,7 +473,7 @@ static int new_lockspace(const char *name, const char *cluster, error = -ENOMEM; - ls = kzalloc(sizeof(struct dlm_ls) + namelen, GFP_NOFS); + ls = kzalloc(sizeof(*ls), GFP_NOFS); if (!ls) goto out; memcpy(ls->ls_name, name, namelen); -- cgit v1.2.3