lkml.org 
[lkml]   [2017]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/9] staging: fsl-mc: fix device ref counting
On Wed, Feb 01, 2017 at 05:43:22AM -0600, laurentiu.tudor@nxp.com wrote:
> From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
>
> Drop unneeded get_device() call at device creation
> and, as per documentation, drop reference count
> after using device_find_child() return.
>
> Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
> ---
> drivers/staging/fsl-mc/bus/dprc-driver.c | 1 +
> drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 1 -
> 2 files changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c
> index 4e416d8..e4b0341 100644
> --- a/drivers/staging/fsl-mc/bus/dprc-driver.c
> +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c
> @@ -188,6 +188,7 @@ static void dprc_add_new_devices(struct fsl_mc_device *mc_bus_dev,
> child_dev = fsl_mc_device_lookup(obj_desc, mc_bus_dev);
> if (child_dev) {
> check_plugged_state_change(child_dev, obj_desc);
> + put_device(&child_dev->dev);
> continue;
> }
>
> diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
> index cc20dc4..7c6a43b 100644
> --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
> +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
> @@ -537,7 +537,6 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc,
> goto error_cleanup_dev;
> }
>
> - (void)get_device(&mc_dev->dev);

This implies that your device reference counting is totally wrong and
messed up. Does this fix anything? Break anything? It should do
something different now...

thanks,

greg k-h

\
 
 \ /
  Last update: 2017-02-03 10:58    [W:0.088 / U:57.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site