Message ID | Y0ICbf8tCtXMn+W0@mail.google.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [next] dlm: Replace one-element array with flexible-array member | expand |
On Sun, Oct 09, 2022 at 12:06:21PM +1300, Paulo Miguel Almeida wrote: > paulo.miguel.almeida.rodenas@gmail.com > Bcc: > Subject: [PATCH][next] dlm: Replace one-element array with flexible-array > member > Reply-To: Something went wrong here :(
diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h index e34c3d2639a5..ce2e32ed2ede 100644 --- a/fs/dlm/dlm_internal.h +++ b/fs/dlm/dlm_internal.h @@ -670,7 +670,7 @@ struct dlm_ls { void *ls_ops_arg; int ls_namelen; - char ls_name[1]; + char ls_name[]; }; /* diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c index bae050df7abf..c3a36f3197da 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(struct dlm_ls) + namelen + 1, GFP_NOFS); if (!ls) goto out; memcpy(ls->ls_name, name, namelen);