[PATCH 04/13] ipaccess: improve error handling

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Holger Hans Peter Freyther holger at freyther.de
Fri Aug 24 06:45:26 UTC 2012


On Fri, Aug 24, 2012 at 12:44:53AM +0200, pablo at gnumonks.org wrote:
> From: Pablo Neira Ayuso <pablo at gnumonks.org>

> @@ -592,15 +634,25 @@ static int ipaccess_bsc_oml_cb(struct ipa_server_link *link, int fd)
>  	ret = osmo_fd_register(bfd);
>  	if (ret < 0) {
>  		LOGP(DLINP, LOGL_ERROR, "could not register FD\n");
> -		close(bfd->fd);
> -		e1inp_line_put(line);
> -		return ret;
> +		goto err_line;



> -        return ret;
> +err_socket:
> +	osmo_fd_unregister(bfd);
> +	close(bfd->fd);
> +	bfd->fd = -1;
> +err_line:
> +	e1inp_line_put(line);
> +	return ret;
>  }

in this case the socket was closed and remains open now? It needs to jump under the
osmo_fd_unregister line.


>  	/* initialize the fds */
>  	for (i = 0; i < ARRAY_SIZE(line->ts); ++i)
> @@ -636,14 +688,24 @@ static int ipaccess_bsc_rsl_cb(struct ipa_server_link *link, int fd)
>  	ret = osmo_fd_register(bfd);
>  	if (ret < 0) {
>  		LOGP(DLINP, LOGL_ERROR, "could not register FD\n");
> -		close(bfd->fd);
> -		e1inp_line_put(line);
> -		return ret;
> +		goto err_line;

same as above.





More information about the OpenBSC mailing list