Bluetooth: Fix EALREADY and ELOOP cases in bt_status()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 30 Oct 2022 07:00:03 +0000 (08:00 +0100)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 12 Dec 2022 22:19:24 +0000 (14:19 -0800)
'err' is known to be <0 at this point.

So, some cases can not be reached because of a missing "-".
Add it.

Fixes: ca2045e059c3 ("Bluetooth: Add bt_status")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/lib.c

index 469a0c9..53a796a 100644 (file)
@@ -170,7 +170,7 @@ __u8 bt_status(int err)
        case -EMLINK:
                return 0x09;
 
-       case EALREADY:
+       case -EALREADY:
                return 0x0b;
 
        case -EBUSY:
@@ -191,7 +191,7 @@ __u8 bt_status(int err)
        case -ECONNABORTED:
                return 0x16;
 
-       case ELOOP:
+       case -ELOOP:
                return 0x17;
 
        case -EPROTONOSUPPORT: