projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4ae7f63
)
nouveau/svm: Replace one-element array with flexible-array member in struct nouveau_svm
author
Gustavo A. R. Silva
<gustavoars@kernel.org>
Wed, 16 Aug 2023 18:04:06 +0000
(12:04 -0600)
committer
Kees Cook
<keescook@chromium.org>
Fri, 29 Sep 2023 18:19:43 +0000
(11:19 -0700)
One-element and zero-length arrays are deprecated. So, replace
one-element array in struct nouveau_svm with flexible-array member.
This results in no differences in binary output.
Link:
https://github.com/KSPP/linux/issues/338
Signed-off-by: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link:
https://lore.kernel.org/r/087a1c335228bd245192bbb2fb347c9af1be5750.1692208802.git.gustavoars@kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
drivers/gpu/drm/nouveau/nouveau_svm.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/nouveau/nouveau_svm.c
b/drivers/gpu/drm/nouveau/nouveau_svm.c
index 186351ecf72fd7e28b451203d0ae0e9d66842e93..00444ad82d18388dc060d39448d5a8166a6ee14d 100644
(file)
--- a/
drivers/gpu/drm/nouveau/nouveau_svm.c
+++ b/
drivers/gpu/drm/nouveau/nouveau_svm.c
@@
-67,7
+67,7
@@
struct nouveau_svm {
struct nouveau_svmm *svmm;
} **fault;
int fault_nr;
- } buffer[
1
];
+ } buffer[];
};
#define FAULT_ACCESS_READ 0
@@
-1063,7
+1063,7
@@
nouveau_svm_init(struct nouveau_drm *drm)
if (drm->client.device.info.family > NV_DEVICE_INFO_V0_PASCAL)
return;
- if (!(drm->svm = svm = kzalloc(s
izeof(*drm->svm
), GFP_KERNEL)))
+ if (!(drm->svm = svm = kzalloc(s
truct_size(drm->svm, buffer, 1
), GFP_KERNEL)))
return;
drm->svm->drm = drm;