staging: fsl-mc: Fixed WARN_ON() in fsl_mc_resource_pool_remove_device
authorJ. German Rivera <German.Rivera@freescale.com>
Sat, 17 Oct 2015 16:18:22 +0000 (11:18 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Oct 2015 03:53:38 +0000 (20:53 -0700)
Check that resource is not NULL before de-referencing it.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fsl-mc/bus/mc-allocator.c

index a45293bfce5ac6f9ff830b3c126bd00d4a9b537e..88d1857521a530c07e50c626b91a67f0dc86f315 100644 (file)
@@ -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);
This page took 0.025066 seconds and 5 git commands to generate.