From: Wei Yongjun Date: Wed, 20 Mar 2013 12:23:37 +0000 (+0800) Subject: Bluetooth: fix error return code in rfcomm_add_listener() X-Git-Tag: firefly_0821_release~3680^2~478^2~21^2^2~234^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0227c7b56959cd8f5edd20b6a47db86fa553e91a;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Gustavo Padovan --- diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index ba93df2af71f..ca957d34b0c8 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: