提交 6f6e0b21 编写于 作者: G Gustavo A. R. Silva 提交者: Sean Paul

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
Signed-off-by: NGustavo A. R. Silva <garsilva@embeddedor.com>
Acked-by: NMark Yao <mark.yao@rock-chips.com>
Signed-off-by: NSean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20170706215833.GA25411@embeddedgus
上级 4086d90c
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册