提交 2379bdbc 编写于 作者: J J. German Rivera 提交者: Greg Kroah-Hartman

staging: fsl-mc: Fixed WARN_ON() in fsl_mc_resource_pool_remove_device

Check that resource is not NULL before de-referencing it.
Signed-off-by: NJ. German Rivera <German.Rivera@freescale.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 09a38ab0
......@@ -111,7 +111,7 @@ static int __must_check fsl_mc_resource_pool_remove_device(struct fsl_mc_device
goto out;
resource = mc_dev->resource;
if (WARN_ON(resource->data != mc_dev))
if (WARN_ON(!resource || resource->data != mc_dev))
goto out;
mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册