diff options
author | J. German Rivera <German.Rivera@freescale.com> | 2015-10-17 16:18:22 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-18 03:53:38 (GMT) |
commit | 2379bdbc6c37ad9db6538dbe8f56f18968b566ad (patch) | |
tree | 9d620de774ad9f3ae1255a70aa9f8efb08d448e9 /drivers/staging/fsl-mc/bus/mc-allocator.c | |
parent | 09a38ab0b1a67e85b11d363dedc1f5de3d0e17e8 (diff) | |
download | linux-2379bdbc6c37ad9db6538dbe8f56f18968b566ad.tar.xz |
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: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/fsl-mc/bus/mc-allocator.c')
-rw-r--r-- | drivers/staging/fsl-mc/bus/mc-allocator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/fsl-mc/bus/mc-allocator.c b/drivers/staging/fsl-mc/bus/mc-allocator.c index a45293b..88d1857 100644 --- a/drivers/staging/fsl-mc/bus/mc-allocator.c +++ b/drivers/staging/fsl-mc/bus/mc-allocator.c @@ -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); |