netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] bluetooth:Fix variable assignment for internal function returns in the function l2cap_bredr_sig_cmd
       [not found] <1450498347-20994-1-git-send-email-xerofoify@gmail.com>
@ 2015-12-20  7:18 ` Marcel Holtmann
  0 siblings, 0 replies; only message in thread
From: Marcel Holtmann @ 2015-12-20  7:18 UTC (permalink / raw)
  To: Nicholas Krause
  Cc: Gustavo F. Padovan, Johan Hedberg, David S. Miller,
	linux-bluetooth, netdev, linux-kernel

Hi Nick,

> This makes all internal functions that can return a error code to
> properly signal this to the caller of the function l2cap_bredr_sig_cmd
> by making their return value equal to the variable err before returning
> to the caller of the function l2cap_bredr_sig_cmd with this value
> as to allow us to correctly signal when a failure has occurred when
> this particular function is called.
> 
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
> net/bluetooth/l2cap_core.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index 7c65ee2..488eebe 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -5319,7 +5319,7 @@ static inline int l2cap_bredr_sig_cmd(struct l2cap_conn *conn,
> 
> 	switch (cmd->code) {
> 	case L2CAP_COMMAND_REJ:
> -		l2cap_command_rej(conn, cmd, cmd_len, data);
> +		err = l2cap_command_rej(conn, cmd, cmd_len, data);
> 		break;

this patch is wrong. Please try to understand on how L2CAP works and look up what the caller of l2cap_bredr_sig_cmd does with the return code. Responses can not cause another command reject.

Regards

Marcel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-20  7:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1450498347-20994-1-git-send-email-xerofoify@gmail.com>
2015-12-20  7:18 ` [PATCH] bluetooth:Fix variable assignment for internal function returns in the function l2cap_bredr_sig_cmd Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).