[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)
committerKim Gunho <gunho.kim@samsung.com>
Mon, 9 Sep 2019 11:15:16 +0000 (20:15 +0900)
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;