Bluetooth: fix error return code in rfcomm_add_listener()
Wei Yongjun [Wed, 20 Mar 2013 12:23:37 +0000 (20:23 +0800)]
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>

net/bluetooth/rfcomm/core.c

index ba93df2..ca957d3 100644 (file)
@@ -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: