lkml.org 
[lkml]   [2015]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 08/12] staging: fsl-mc: Fixed bug in fsl_mc_allocator_remove
Date
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>
---
CHANGE HISTORY

Changes in v3:
- Added missing signed-off-by

Changes in v2: none

drivers/staging/fsl-mc/bus/mc-allocator.c | 8 +++++---
1 file 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 527cb4b..e9c3dec 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");
--
2.3.3


\
 
 \ /
  Last update: 2015-10-17 18:41    [W:1.874 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site