summaryrefslogtreecommitdiffstats
path: root/drivers/staging/fsl-mc
diff options
context:
space:
mode:
authorJ. German Rivera <German.Rivera@freescale.com>2015-10-17 11:18:20 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-17 20:53:38 -0700
commit6958cd44834ecd1e490be94343c44fc64076d391 (patch)
treef5d2b83336e02f8fb0747fca3d351343ca50e661 /drivers/staging/fsl-mc
parent95e9a09af4b55b8a1daa4d62afb287994aecfb8e (diff)
downloadtalos-obmc-linux-6958cd44834ecd1e490be94343c44fc64076d391.tar.gz
talos-obmc-linux-6958cd44834ecd1e490be94343c44fc64076d391.zip
staging: fsl-mc: Fixed bug in fsl_mc_allocator_remove
Call fsl_mc_resource_pool_remove_device() only if mc_dev->resource is not NULL. 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')
-rw-r--r--drivers/staging/fsl-mc/bus/mc-allocator.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/staging/fsl-mc/bus/mc-allocator.c b/drivers/staging/fsl-mc/bus/mc-allocator.c
index 527cb4bc379a..e9c3dec201cb 100644
--- a/drivers/staging/fsl-mc/bus/mc-allocator.c
+++ b/drivers/staging/fsl-mc/bus/mc-allocator.c
@@ -511,9 +511,11 @@ static int fsl_mc_allocator_remove(struct fsl_mc_device *mc_dev)
if (WARN_ON(!FSL_MC_IS_ALLOCATABLE(mc_dev->obj_desc.type)))
goto out;
- error = fsl_mc_resource_pool_remove_device(mc_dev);
- if (error < 0)
- goto out;
+ if (mc_dev->resource) {
+ error = fsl_mc_resource_pool_remove_device(mc_dev);
+ if (error < 0)
+ goto out;
+ }
dev_dbg(&mc_dev->dev,
"Allocatable MC object device unbound from fsl_mc_allocator driver");
OpenPOWER on IntegriCloud