]> www.infradead.org Git - users/hch/misc.git/commitdiff
wifi: mwifiex: fix double free in mwifiex_send_rgpower_table()
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 5 Sep 2025 08:02:14 +0000 (11:02 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 5 Sep 2025 08:46:04 +0000 (10:46 +0200)
The "hostcmd" is freed using cleanup.h, so calling kfree() will lead to
a double free.  Delete the kfree().

Fixes: 7b6f16a25806 ("wifi: mwifiex: add rgpower table loading support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Link: https://patch.msgid.link/aLqZBh5_dSHUb4AE@stanley.mountain
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/marvell/mwifiex/sta_cmd.c

index 6d9e2af29a69da3f6b1d9386788b4d92273380b1..91d5098081e8b97420322484a229654c026e4618 100644 (file)
@@ -1521,10 +1521,8 @@ int mwifiex_send_rgpower_table(struct mwifiex_private *priv, const u8 *data,
                return -ENOMEM;
 
        _data = kmemdup(data, size, GFP_KERNEL);
-       if (!_data) {
-               kfree(hostcmd);
+       if (!_data)
                return -ENOMEM;
-       }
 
        pos = _data;
        ptr = hostcmd->cmd;