Commit 85c57c2
Bluetooth: host: ensure ownership of conn on TX path
This is a bug-fix:
When upper layers want to send something, they add a `conn` object to a
list. They do so by adding a node on `struct conn` rather than the object
itself.
We forgot to increase the reference count of the connection object when
doing so. This means that there can be a scenario where the conn object is
destroyed and re-used while still being on the TX list/queue.
This is bad for obvious reasons.
This patch fixes that by:
- increasing the refcount when putting on the TX list
- decreasing the refcount *only* when popping off the TX list
- passing a new reference from `get_conn_ready` into `bt_conn_tx_processor`
Signed-off-by: Jonathan Rico <[email protected]>1 parent 71f668d commit 85c57c2
3 files changed
+39
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
776 | 780 | | |
777 | 781 | | |
778 | 782 | | |
| |||
804 | 808 | | |
805 | 809 | | |
806 | 810 | | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
807 | 817 | | |
808 | 818 | | |
809 | 819 | | |
| |||
857 | 867 | | |
858 | 868 | | |
859 | 869 | | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
860 | 876 | | |
861 | 877 | | |
862 | 878 | | |
| |||
887 | 903 | | |
888 | 904 | | |
889 | 905 | | |
| 906 | + | |
890 | 907 | | |
891 | 908 | | |
892 | 909 | | |
| |||
902 | 919 | | |
903 | 920 | | |
904 | 921 | | |
| 922 | + | |
| 923 | + | |
905 | 924 | | |
906 | 925 | | |
907 | | - | |
| 926 | + | |
908 | 927 | | |
909 | 928 | | |
910 | 929 | | |
| |||
985 | 1004 | | |
986 | 1005 | | |
987 | 1006 | | |
988 | | - | |
| 1007 | + | |
| 1008 | + | |
989 | 1009 | | |
990 | 1010 | | |
991 | 1011 | | |
| |||
994 | 1014 | | |
995 | 1015 | | |
996 | 1016 | | |
997 | | - | |
| 1017 | + | |
| 1018 | + | |
998 | 1019 | | |
999 | 1020 | | |
1000 | 1021 | | |
| |||
1008 | 1029 | | |
1009 | 1030 | | |
1010 | 1031 | | |
1011 | | - | |
| 1032 | + | |
| 1033 | + | |
1012 | 1034 | | |
1013 | 1035 | | |
1014 | 1036 | | |
| |||
1044 | 1066 | | |
1045 | 1067 | | |
1046 | 1068 | | |
1047 | | - | |
| 1069 | + | |
1048 | 1070 | | |
1049 | 1071 | | |
1050 | 1072 | | |
1051 | 1073 | | |
1052 | 1074 | | |
1053 | 1075 | | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
1054 | 1080 | | |
1055 | 1081 | | |
1056 | 1082 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
550 | 556 | | |
551 | 557 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| 314 | + | |
| 315 | + | |
314 | 316 | | |
315 | 317 | | |
316 | 318 | | |
| |||
0 commit comments