mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-07 05:33:20 +09:00
UPSTREAM: 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
Change-Id: Iba535170f6ba6e8b6e3f53e898a79957e753229c
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Acked-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20170706215833.GA25411@embeddedgus
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit 6f6e0b217a)
This commit is contained in:
committed by
Tao Huang
parent
93efecf2b6
commit
564447706c
@@ -1257,7 +1257,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;
|
||||
|
||||
Reference in New Issue
Block a user