浏览代码

Bluetooth: fix error return code in rfcomm_add_listener()

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>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Wei Yongjun 12 年之前
父节点
当前提交
0227c7b569
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      net/bluetooth/rfcomm/core.c

+ 3 - 1
net/bluetooth/rfcomm/core.c

@@ -2004,8 +2004,10 @@ static int rfcomm_add_listener(bdaddr_t *ba)
 
 
 	/* Add listening session */
 	/* Add listening session */
 	s = rfcomm_session_add(sock, BT_LISTEN);
 	s = rfcomm_session_add(sock, BT_LISTEN);
-	if (!s)
+	if (!s) {
+		err = -ENOMEM;
 		goto failed;
 		goto failed;
+	}
 
 
 	return 0;
 	return 0;
 failed:
 failed: