drm/msm: remove unnecessary NULL check
Subsystems (4)
PATCH v2 1/1 drm/msm: remove unnecessary NULL check
This NULL check was required when it was added, but we shuffled the code around and now it's not. The inconsistent NULL checking triggers a Smatch warning:
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c:847 mdp5_init() warn:
variable dereferenced before check 'mdp5_kms' (see line 782)
---
v2: Added a Fixes tag. It's not really a bug fix and so adding the fixes tag is slightly unfair but it should prevent this patch from accidentally getting backported before the refactoring and causing an issue.
Btw, fixes tags are often unfair like this. People look at fixes tags and think, "the fix introduced a bug" but actually it's really common that the fix was just not complete. But from a backporting perspective it makes sense to tie them together.
Plus everyone introduces bugs. If you're not introducing bugs, then you're probably not writing a lot of code.
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +1 -2
@@ -844,8 +844,7 @@ static int mdp5_init(struct platform_device *pdev, struct drm_device *dev)return 0 ; fail: -if (mdp5_kms) -mdp5_destroy (mdp5_kms); +mdp5_destroy (mdp5_kms);return ret; }
Signature · 1 line
2.39.2
Quoted 9 lines · Dan Carpenter
This NULL check was required when it was added, but we shuffled the code around and now it's not. The inconsistent NULL checking triggers a Smatch warning:
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c:847mdp5_init()warn:
variable dereferenced before check 'mdp5_kms' (see line 782)Fixes 1f50db2f3e1e ("drm/msm/mdp5: move resource allocation to the _probe function"Signed-off-by Dan Carpenter <[email protected]>
(already provided for (implicit) v1, but wasn't picked up)
Thanks
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
Quoted 20 lines · Dan Carpenter
This NULL check was required when it was added, but we shuffled the code around and now it's not. The inconsistent NULL checking triggers a Smatch warning:
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c:847mdp5_init()warn:
variable dereferenced before check 'mdp5_kms' (see line 782)Fixes 1f50db2f3e1e ("drm/msm/mdp5: move resource allocation to the _probe function"Signed-off-by Dan Carpenter <[email protected]>---
v2: Added a Fixes tag. It's not really a bug fix and so adding the fixes tag is slightly unfair but it should prevent this patch from accidentally getting backported before the refactoring and causing an issue.Btw, fixes tags are often unfair like this. People look at fixes tags and think, "the fix introduced a bug" but actually it's really common that the fix was just not complete. But from a backporting perspective it makes sense to tie them together.
Quoted 5 lines
Plus everyone introduces bugs. If you're not introducing bugs, then you're probably not writing a lot of code.
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Signature · 2 lines
With best wishes Dmitry
Quoted 20 lines · Dan Carpenter
This NULL check was required when it was added, but we shuffled the code around and now it's not. The inconsistent NULL checking triggers a Smatch warning:
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c:847mdp5_init()warn:
variable dereferenced before check 'mdp5_kms' (see line 782)Fixes 1f50db2f3e1e ("drm/msm/mdp5: move resource allocation to the _probe function"Signed-off-by Dan Carpenter <[email protected]>---
v2: Added a Fixes tag. It's not really a bug fix and so adding the fixes tag is slightly unfair but it should prevent this patch from accidentally getting backported before the refactoring and causing an issue.Btw, fixes tags are often unfair like this. People look at fixes tags and think, "the fix introduced a bug" but actually it's really common that the fix was just not complete. But from a backporting perspective it makes sense to tie them together.
Quoted 6 lines
Plus everyone introduces bugs. If you're not introducing bugs, then you're probably not writing a lot of code.
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
LGTM,
Quoted 11 lines · Abhinav Kumar
Quoted 8 lines · Dan Carpenter
This NULL check was required when it was added, but we shuffled the code around and now it's not. The inconsistent NULL checking triggers a Smatch warning:
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c:847mdp5_init()warn:
variable dereferenced before check 'mdp5_kms' (see line 782)Fixes 1f50db2f3e1e ("drm/msm/mdp5: move resource allocation to the _probe function"
A small error here. Its missing the closing brace for the Fixes tag. Checkpatch cries without it.
I have fixed it while applying.
Quoted 23 lines
Quoted 12 lines
Signed-off-by Dan Carpenter <[email protected]>---
v2: Added a Fixes tag. It's not really a bug fix and so adding the fixes tag is slightly unfair but it should prevent this patch from accidentally getting backported before the refactoring and causing an issue.Btw, fixes tags are often unfair like this. People look at fixes tags and think, "the fix introduced a bug" but actually it's really common that the fix was just not complete. But from a backporting perspective it makes sense to tie them together.
Quoted 6 lines
Plus everyone introduces bugs. If you're not introducing bugs, then you're probably not writing a lot of code.
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c| 3 +--1 file changed, 1 insertion(+), 2 deletions(-)LGTM,
Reviewed-by Abhinav Kumar <[email protected]>
Quoted 10 lines · Abhinav Kumar
Quoted 7 lines · Abhinav Kumar
Quoted 4 lines · Dan Carpenter
This NULL check was required when it was added, but we shuffled the code around and now it's not.? The inconsistent NULL checking triggers a Smatch warning:
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
????
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c:847mdp5_init()warn:
???? variable dereferenced before check 'mdp5_kms' (see line 782)Fixes 1f50db2f3e1e ("drm/msm/mdp5: move resource allocation to the
_probefunction"A small error here. Its missing the closing brace for the Fixes tag. Checkpatch cries without it.
Sorry. I must have accidentally deleted it after I ran checkpatch.
Quoted 1 line
I have fixed it while applying.
Thanks!
regards,
dan carpenter
Abhinav Kumar
AppliedQuoted 8 lines · Dan Carpenter
This NULL check was required when it was added, but we shuffled the code around and now it's not. The inconsistent NULL checking triggers a Smatch warning:
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c:847mdp5_init()warn:
variable dereferenced before check 'mdp5_kms' (see line 782)[...]
Applied, thanks!
[1/1] drm/msm: remove unnecessary NULL check
https://gitlab.freedesktop.org/drm/msm/-/commit/56466f653cb5
Best regards,
Signature · 1 line
Abhinav Kumar <[email protected]>