summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavoars@kernel.org>2023-08-16 20:05:06 +0200
committerKees Cook <keescook@chromium.org>2023-09-29 20:19:43 +0200
commit4cb2e89fea5fe4238c554fcb62afed5231e1d020 (patch)
tree4ebe6fe1526ceb28885837bb6db9d7eedaef8ed1 /drivers/gpu
parentnouveau/svm: Replace one-element array with flexible-array member in struct n... (diff)
downloadlinux-4cb2e89fea5fe4238c554fcb62afed5231e1d020.tar.xz
linux-4cb2e89fea5fe4238c554fcb62afed5231e1d020.zip
nouveau/svm: Split assignment from if conditional
Fix checkpatch.pl ERROR: do not use assignment in if condition. Signed-off-by: "Gustavo A. R. Silva" <gustavoars@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/6b900e80b5587187c68efc788f5b042ca747d374.1692208802.git.gustavoars@kernel.org Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_svm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c
index 00444ad82d18..cc03e0c22ff3 100644
--- a/drivers/gpu/drm/nouveau/nouveau_svm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_svm.c
@@ -1063,7 +1063,8 @@ nouveau_svm_init(struct nouveau_drm *drm)
if (drm->client.device.info.family > NV_DEVICE_INFO_V0_PASCAL)
return;
- if (!(drm->svm = svm = kzalloc(struct_size(drm->svm, buffer, 1), GFP_KERNEL)))
+ drm->svm = svm = kzalloc(struct_size(drm->svm, buffer, 1), GFP_KERNEL);
+ if (!drm->svm)
return;
drm->svm->drm = drm;