linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] Bluetooth: fix error return code in rfcomm_add_listener()
@ 2013-03-20 12:23 Wei Yongjun
  2013-03-20 17:19 ` Gustavo Padovan
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2013-03-20 12:23 UTC (permalink / raw)
  To: marcel, gustavo, johan.hedberg, Dean_Jenkins, andrei.emeltchenko,
	s.syam
  Cc: yongjun_wei, linux-bluetooth

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 net/bluetooth/rfcomm/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index ba93df2..ca957d3 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -2004,8 +2004,10 @@ static int rfcomm_add_listener(bdaddr_t *ba)
 
 	/* Add listening session */
 	s = rfcomm_session_add(sock, BT_LISTEN);
-	if (!s)
+	if (!s) {
+		err = -ENOMEM;
 		goto failed;
+	}
 
 	return 0;
 failed:

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] Bluetooth: fix error return code in rfcomm_add_listener()
  2013-03-20 12:23 [PATCH -next] Bluetooth: fix error return code in rfcomm_add_listener() Wei Yongjun
@ 2013-03-20 17:19 ` Gustavo Padovan
  0 siblings, 0 replies; 2+ messages in thread
From: Gustavo Padovan @ 2013-03-20 17:19 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: marcel, johan.hedberg, Dean_Jenkins, andrei.emeltchenko, s.syam,
	yongjun_wei, linux-bluetooth

Hi Wei,

* Wei Yongjun <weiyj.lk@gmail.com> [2013-03-20 20:23:37 +0800]:

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return a negative error code from the error handling
> case instead of 0, as returned elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  net/bluetooth/rfcomm/core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Patch has been applied to bluetooth-next. Thanks.

	Gustavo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-20 17:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-20 12:23 [PATCH -next] Bluetooth: fix error return code in rfcomm_add_listener() Wei Yongjun
2013-03-20 17:19 ` Gustavo Padovan

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).