Re: [PATCH BlueZ v2] mesh: Fix segmentation fault when removing a node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Applied with agreed upon minor adjustments, which have been build and
run tested.

On Thu, 2019-07-04 at 10:36 -0700, Inga Stotland wrote:
> This fixes a segmentation fault introduced by earlier changes.
> Segmentation fault was used by accessing a queu that has been
> destroyed, but the corresponding pointer hasn't been set to NULL.
> ---
>  mesh/node.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/mesh/node.c b/mesh/node.c
> index ad94d885c..8e9da8988 100644
> --- a/mesh/node.c
> +++ b/mesh/node.c
> @@ -260,12 +260,16 @@ static void free_node_resources(void *data)
>  	/* Unregister io callbacks */
>  	if (node->net)
>  		mesh_net_detach(node->net);
> +
>  	mesh_net_free(node->net);
> +	node->net = NULL;
>  
>  	l_queue_destroy(node->elements, element_free);
> -	l_free(node->comp);
> +	node->elements = NULL;
>  
>  	free_node_dbus_resources(node);
> +
> +	l_free(node->comp);
>  	l_free(node);
>  }
>  




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux