Currently finds 4 locations: ./drivers/net/wireless/realtek/rtw89/fw.c:2557:7-12: opportunity for str_alloc_free(valid) ./drivers/net/wireless/realtek/rtw89/fw.c:2693:7-12: opportunity for str_alloc_free(valid) ./drivers/android/tests/binder_alloc_kunit.c:196:6-21: opportunity for str_alloc_free(alloc -> pages [ i ]) ./mm/slub.c:1634:3-8: opportunity for str_alloc_free(alloc)
Patch 3 is based on https://lore.kernel.org/linux-hardening/cahp75vdhy814nrfyufweqrd4-dwyzhgh25otsub5efprkpv...@mail.gmail.com/T/#t. --- Changes in v3: Add first user for this helper v2: https://lore.kernel.org/linux-hardening/cahp75vdvdr0tpzuddpsoj4nixk-6qo_x6or9iy9lnwso1q6...@mail.gmail.com/T/#mfb405519f7b3a06f4fcaa8e5a799da5299d9ee85 Jiazi Li (3): lib/string_choices: Add str_alloc_free() helper wifi: rtw89: Make use of str_alloc_free helper coccinelle: Add rules to find str_alloc_free() replacements drivers/net/wireless/realtek/rtw89/fw.c | 4 +-- include/linux/string_choices.h | 6 ++++ scripts/coccinelle/api/string_choices.cocci | 38 +++++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) -- 2.49.0
