All of lore.kernel.org
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v4 1/7] profiles/network: Fix sending error in bnep server add
Date: Thu, 12 Mar 2015 17:41:17 +0100	[thread overview]
Message-ID: <5150499.1tWFAFZMjX@leonov> (raw)
In-Reply-To: <1426176926-22702-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

Hi Grzegorz,

On Thursday 12 of March 2015 17:15:26 Grzegorz Kolodziejczyk wrote:
> If bnep server add will not proceed successfully, approperiate error
> should be returned. Now it returns error if control message send will
> fail.
> ---
>  profiles/network/bnep.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/profiles/network/bnep.c b/profiles/network/bnep.c
> index adddc33..779c5fb 100644
> --- a/profiles/network/bnep.c
> +++ b/profiles/network/bnep.c
> @@ -650,6 +650,7 @@ int bnep_server_add(int sk, char *bridge, char *iface,
> const bdaddr_t *addr, /* Processing BNEP_SETUP_CONNECTION_REQUEST_MSG */
>  	rsp = bnep_setup_decode(sk, req, &dst);
>  	if (rsp != BNEP_SUCCESS) {
> +		err = -rsp;
>  		error("bnep: error while decoding setup connection request: %d",
>  									rsp);
>  		goto reply;
> @@ -673,10 +674,11 @@ int bnep_server_add(int sk, char *bridge, char *iface,
> const bdaddr_t *addr, rsp = BNEP_CONN_NOT_ALLOWED;
> 
>  reply:
> -	err = bnep_send_ctrl_rsp(sk, BNEP_SETUP_CONN_RSP, rsp);
> -	if (err < 0)
> +	if (bnep_send_ctrl_rsp(sk, BNEP_SETUP_CONN_RSP, rsp) < 0) {
> +		err = -errno;
>  		error("bnep: send ctrl rsp error: %s (%d)", strerror(errno),
>  									errno);
> +	}
> 
>  	return err;
>  }

Patch applied, thanks.

-- 
BR
Szymon Janc

  reply	other threads:[~2015-03-12 16:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-12 16:15 [PATCH v4 1/7] profiles/network: Fix sending error in bnep server add Grzegorz Kolodziejczyk
2015-03-12 16:41 ` Szymon Janc [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-03-12 16:06 [PATCH v4 0/7] Create bneptest tool Grzegorz Kolodziejczyk
2015-03-12 16:06 ` [PATCH v4 1/7] profiles/network: Fix sending error in bnep server add Grzegorz Kolodziejczyk
2015-03-12 16:12   ` Szymon Janc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5150499.1tWFAFZMjX@leonov \
    --to=szymon.janc@tieto.com \
    --cc=grzegorz.kolodziejczyk@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.