drm/rockchip: fix NULL check on devm_kzalloc() return value
Subsystems (4)
PATCH 1/1 drm/rockchip: fix NULL check on devm_kzalloc() return value
The right variable to check here is port, not dp.
This issue was detected using Coccinelle and the following semantic patch:
@@
expression x;
identifier fld;
@@
* x = devm_kzalloc(...);
... when != x == NULL
x->fld
--- drivers/gpu/drm/rockchip/cdn-dp-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/rockchip/cdn-dp-core.c +1 -1
@@ -1195,7 +1195,7 @@ static int cdn_dp_probe(struct platform_device *pdev)continue ; port =devm_kzalloc (dev,sizeof (*port),GFP_KERNEL ); -if (!dp) +if (!port)return -ENOMEM ; port->extcon = extcon;
Signature · 1 line
2.5.0
Quoted 9 lines · Gustavo A. R. Silva
The right variable to check here is port, not dp.
This issue was detected using Coccinelle and the following semantic patch:
@@
expression x;
identifier fld;
@@
Quoted 5 lines
* x = devm_kzalloc(...); ... when != x == NULL x->fldSigned-off-by Gustavo A. R. Silva <[email protected]>
Thanks for the fix,
Quoted 17 lines
--- drivers/gpu/drm/rockchip/cdn-dp-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/rockchip/cdn-dp-core.c +1
-1@@ -1195,7 +1195,7 @@ static int cdn_dp_probe(struct platform_device *pdev)continue ; port =devm_kzalloc (dev,sizeof (*port),GFP_KERNEL ); -if (!dp) +if (!port)return -ENOMEM ; port->extcon = extcon;
Signature · 1 line
?ark Yao
Quoted 14 lines · Mark yao
Quoted 13 lines · Gustavo A. R. Silva
The right variable to check here is port, not dp.
This issue was detected using Coccinelle and the following semantic patch:
@@
expression x;
identifier fld;
@@* x = devm_kzalloc(...); ... when != x == NULL x->fld
Quoted 5 lines
Quoted 1 line
Signed-off-by Gustavo A. R. Silva <[email protected]>Thanks for the fix,
Acked-by Mark Yao <[email protected]>
Hi Mark,
I've applied this patch, but in the future, please apply changes directly instead of just acking.
If you're unable to apply it for some reason (vacation, etc), please reach out to one of the -misc maintainers via email or irc so we don't inadvertently lose track of it on the list.
Sean
Quoted 26 lines
Quoted 16 lines
--- drivers/gpu/drm/rockchip/cdn-dp-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/rockchip/cdn-dp-core.c +1
-1@@ -1195,7 +1195,7 @@ static int cdn_dp_probe(struct platform_device *pdev)continue ; port =devm_kzalloc (dev,sizeof (*port),GFP_KERNEL ); -if (!dp) +if (!port)return -ENOMEM ; port->extcon = extcon;Signature · 7 lines
?ark Yao _______________________________________________ dri-devel mailing list dri-devel at lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 1 line
Sean Paul, Software Engineer, Google / Chromium OS
Quoted 23 lines · Sean Paul
Quoted 10 lines · Mark yao
Quoted 9 lines · Gustavo A. R. Silva
The right variable to check here is port, not dp.
This issue was detected using Coccinelle and the following semantic patch:
@@
expression x;
identifier fld;
@@Quoted 8 lines
Quoted 5 lines
* x = devm_kzalloc(...); ... when != x == NULL x->fldSigned-off-by Gustavo A. R. Silva <[email protected]>Thanks for the fix,
Acked-by Mark Yao <[email protected]>Hi Mark,
I've applied this patch, but in the future, please apply changes directly instead of just acking.
Quoted 5 lines
If you're unable to apply it for some reason (vacation, etc), please reach out to one of the -misc maintainers via email or irc so we don't inadvertently lose track of it on the list.
Sean
Hi Sean
Got it, I will do it right next time.
Thanks to inform me this,
Quoted 25 lines
Quoted 25 lines
Quoted 16 lines
--- drivers/gpu/drm/rockchip/cdn-dp-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/rockchip/cdn-dp-core.c +1
-1@@ -1195,7 +1195,7 @@ static int cdn_dp_probe(struct platform_device *pdev)continue ; port =devm_kzalloc (dev,sizeof (*port),GFP_KERNEL ); -if (!dp) +if (!port)return -ENOMEM ; port->extcon = extcon;Signature · 7 lines
?ark Yao _______________________________________________ dri-devel mailing list dri-devel at lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 1 line
?ark Yao