gpu: drm/nouveau/nouveau_fence.c: remove unnecessary null pointer check
Subsystems (3)
PATCH 1/1 gpu: drm/nouveau/nouveau_fence.c: remove unnecessary null pointer check
the variable sender is dereferenced in line 190, so it is no reason to check null again in line 198.
--- drivers/gpu/drm/nouveau/nouveau_fence.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/nouveau/nouveau_fence.c +3 -5
@@ -195,11 +195,9 @@ nouveau_fence_new(struct nouveau_channel *chan, struct nouveau_fence **pfence)return -ENOMEM ;kref_init (&fence->kref); -if (chan) { - ret =nouveau_fence_emit (fence, chan); -if (ret) -nouveau_fence_unref (&fence); - } + ret =nouveau_fence_emit (fence, chan); +if (ret) +nouveau_fence_unref (&fence); *pfence = fence;return ret;
Signature · 1 line
1.7.10.4
Quoted 2 lines · Cong Ding
the variable sender is dereferenced in line 190, so it is no reason to check null again in line 198.
Did you mean "The variable 'chan'"?
David
Quoted 6 lines · David Howells
Quoted 2 lines · Cong Ding
the variable sender is dereferenced in line 190, so it is no reason to check null again in line 198.
Did you mean "The variable 'chan'"?
sorry, my fault. so should I send a new version to correct the typo?
- cong
Quoted 5 lines · Cong Ding
Quoted 4 lines
Quoted 2 lines
the variable sender is dereferenced in line 190, so it is no reason to check null again in line 198.
Did you mean "The variable 'chan'"?
sorry, my fault. so should I send a new version to correct the typo?
Yep.
David
PATCH v2 1/1 gpu: drm/nouveau/nouveau_fence.c: remove unnecessary null pointer check
the variable chan is dereferenced in line 190, so it is no reason to check null again in line 198.
--- drivers/gpu/drm/nouveau/nouveau_fence.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/nouveau/nouveau_fence.c +3 -5
@@ -195,11 +195,9 @@ nouveau_fence_new(struct nouveau_channel *chan, struct nouveau_fence **pfence)return -ENOMEM ;kref_init (&fence->kref); -if (chan) { - ret =nouveau_fence_emit (fence, chan); -if (ret) -nouveau_fence_unref (&fence); - } + ret =nouveau_fence_emit (fence, chan); +if (ret) +nouveau_fence_unref (&fence); *pfence = fence;return ret;
Signature · 1 line
1.7.10.4