Re: [PATCH 2/3] Fix avrcp unregister potential crash

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

 



Hi Chanyeol,

On Fri, May 18, 2012, chanyeol.park@xxxxxxxxxxx wrote:
> From: Chan-yeol Park <chanyeol.park@xxxxxxxxxxx>
> 
> ---
>  audio/avrcp.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/audio/avrcp.c b/audio/avrcp.c
> index df39d04..2e946c1 100644
> --- a/audio/avrcp.c
> +++ b/audio/avrcp.c
> @@ -1272,8 +1272,11 @@ void avrcp_unregister(const bdaddr_t *src)
>  
>  	servers = g_slist_remove(servers, server);
>  
> -	remove_record_from_server(server->ct_record_id);
> -	remove_record_from_server(server->tg_record_id);
> +	if (server->ct_record_id)
> +		remove_record_from_server(server->ct_record_id);
> +
> +	if (server->tg_record_id)
> +		remove_record_from_server(server->tg_record_id);
>  
>  	avctp_unregister(&server->src);
>  	g_free(server);

I don't think the commit message for this patch is truthful. If you look
at the code the remove_record_from_server will return ENOENT if you pass
it a non-existent handle. I.e. it will not crash. Please fix the commit
message to reflect what exactly is being fixed (i.e. an unnecessary call
to remove_record_from_server if there is no record handle).

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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