Skip to contentSkip to conversation

obexd: Fix callback->func =! NULL in the xfer_complete() func

PATCH In review wangyouwan 2 participants 2 messages Jun 13, 2022 Bluetooth drivers

lore
Share & tools
lore

wangyouwan

author
#0 lore raw

PATCH 1/1 obexd: Fix callback->func =! NULL in the xfer_complete() func

xfer_complete (obex=0x557d242c8cf0, err=0x557d242ca470, user_data=0x557d242ca300) at obexd/client/transfer.c:659
659 obexd/client/transfer.c: 没有那个文件或目录.
(gdb) n
661 in obexd/client/transfer.c
(gdb) n
663 in obexd/client/transfer.c
(gdb) p callback->func
$1 = (transfer_callback_t) 0x0
(gdb) n
668 in obexd/client/transfer.c
(gdb) n
671 in obexd/client/transfer.c
(gdb) n
672 in obexd/client/transfer.c
(gdb) n
676 in obexd/client/transfer.c
(gdb) n
677 in obexd/client/transfer.c
(gdb) n
0x0000000000000000 in ?? ()
(gdb) s
Cannot find bounds of current function
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.

---
 obexd/client/transfer.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
obexd/client/transfer.c +4 -1
index dccce03b4..a7a85a0c0 100644
@@ -666,7 +666,10 @@ static void xfer_complete(GObex *obex, GError *err, gpointer user_data)
 	else
 		transfer_set_status(transfer, TRANSFER_STATUS_COMPLETE);
 
-	if (callback)
+	if (callback == NULL)
+		return;
+
+	if (callback->func)
 		callback->func(transfer, err, callback->data);
 }
 
Signature · 1 line
2.20.1
#1 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=649824

---Test result---

Test Summary:

CheckPatch                    PASS      0.66 seconds
GitLint                       PASS      0.46 seconds
Prep - Setup ELL              PASS      54.03 seconds
Build - Prep                  PASS      0.62 seconds
Build - Configure             PASS      10.20 seconds
Build - Make                  PASS      1870.58 seconds
Make Check                    PASS      13.00 seconds
Make Check w/Valgrind         PASS      552.84 seconds
Make Distcheck                PASS      292.56 seconds
Build w/ext ELL - Configure   PASS      10.64 seconds
Build w/ext ELL - Make        PASS      1821.67 seconds
Incremental Build with patchesPASS      0.00 seconds

---
Regards,
Linux Bluetooth