Commit bddbe13
bus: fsl-mc: Fix potential double device reference in fsl_mc_get_endpoint()
The fsl_mc_get_endpoint() function may call fsl_mc_device_lookup()
twice, which would increment the device's reference count twice if
both lookups find a device. This could lead to a reference count leak.
Found by code review.
Cc: stable@vger.kernel.org
Fixes: 1ac210d ("bus: fsl-mc: add the fsl_mc_get_endpoint function")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Fixes: 8567494 ("bus: fsl-mc: rescan devices if endpoint not found")
Link: https://patch.msgid.link/20250717022309.3339976-1-make24@iscas.ac.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 6832a93 commit bddbe13
1 file changed
+9
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
943 | 943 | | |
944 | 944 | | |
945 | 945 | | |
| 946 | + | |
946 | 947 | | |
947 | 948 | | |
948 | 949 | | |
| |||
966 | 967 | | |
967 | 968 | | |
968 | 969 | | |
| 970 | + | |
| 971 | + | |
969 | 972 | | |
970 | 973 | | |
971 | 974 | | |
972 | 975 | | |
973 | 976 | | |
974 | 977 | | |
975 | 978 | | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
984 | | - | |
985 | | - | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
986 | 983 | | |
| 984 | + | |
| 985 | + | |
987 | 986 | | |
988 | 987 | | |
989 | 988 | | |
| |||
0 commit comments