Re: [PATCH 1/2] Add messages backend initialization and finalization

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

 



Hi Slawek,

On Mon, May 23, 2011, Slawomir Bochenski wrote:
> +	err = messages_init();
> +	if (err < 0)
> +		goto failed_messages_init;
> +
>  	err = obex_mime_type_driver_register(&mime_map);
>  	if (err < 0)
>  		goto failed_mime;
> @@ -275,6 +279,9 @@ failed_mas_reg:
>  	obex_mime_type_driver_unregister(&mime_map);
>  
>  failed_mime:
> +	messages_exit();
> +
> +failed_messages_init:
>  	return err;
>  }

In this case it'd be simpler to do the following instead of adding the
new label:

	if (err < 0)
		return err;

If there was more complex cleanup involved then the new label would make
sense, but not really with a simple return statement.

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