Re: [PATCH v5 3/5] staging: rtl8723bs: replace rtw_zmalloc() with kzalloc()
From: Andy Shevchenko
Date: Wed Feb 04 2026 - 05:27:52 EST
On Wed, Feb 04, 2026 at 03:44:52PM +0900, Minu Jin wrote:
> Replace the wrapper function rtw_zmalloc() with standard kzalloc().
> Use kzalloc() for rtw_malloc() calls that were followed by manual
> zero initialization.
>
> Additionally, use array_size() and size_add() to prevent potential
> integer overflows during allocation size calculation.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
...
> static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
> struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
>
> param_len = sizeof(struct ieee_param) + params->key_len;
> - param = rtw_malloc(param_len);
> + param = kzalloc(param_len, GFP_KERNEL);
> if (!param)
> return -1;
Also -ENOMEM?
--
With Best Regards,
Andy Shevchenko