[RAMEN9610-19755]wlbt: Resource Leak prevent issue in APF
authorSrishti Piplani <srishti.p@samsung.com>
Thu, 5 Sep 2019 09:50:05 +0000 (15:20 +0530)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:36 +0000 (20:23 +0300)
Free the program variable, before doing a kmalloc,
in order to fix resource leak prevent issue.

Change-Id: I841c958401abeb7a359e8dacae6da530ee4a39a9
SCSC-Bug-Id: HOST-10865
Signed-off-by: Srishti Piplani <srishti.p@samsung.com>
Signed-off-by: Kim Gunho <gunho.kim@samsung.com>
drivers/net/wireless/scsc/nl80211_vendor.c

index 6c803c3e08719ad2f59fb5c37054ca3ce7fc6be3..7e6c7ac96313c6037681bc84b9c543bec695ab00 100755 (executable)
@@ -2707,6 +2707,7 @@ static int slsi_apf_set_filter(struct wiphy *wiphy, struct wireless_dev *wdev, c
                case SLSI_APF_ATTR_PROGRAM_LEN:
                {
                        program_len = nla_get_u32(attr);
+                       kfree(program);
                        program = kmalloc(program_len, GFP_KERNEL);
                        if (!program) {
                                ret = -ENOMEM;