Bob Copeland <me@xxxxxxxxxxxxxxx> wrote: > smatch reports: > > sta_cmdresp.c:1053 mwifiex_create_custom_regdomain() warn: possible memory leak of 'regd' > > Indeed, mwifiex_create_custom_regdomain() returns NULL in the > case that channel is missing in the TLV without freeing regd. > > Moreover, some other error paths in this function return ERR_PTR > values which are assigned without checking to the regd field in > the mwifiex_adapter struct. The latter is only null-checked where > used. > > Fix by freeing regd in the error path, and only update > priv->adapter->regd if the returned pointer is valid. > > Cc: Amitkumar Karwar <akarwar@xxxxxxxxxxx> > Cc: Nishant Sarmukadam <nishants@xxxxxxxxxxx> > Signed-off-by: Bob Copeland <me@xxxxxxxxxxxxxxx> Thanks, 1 patch applied to wireless-drivers-next.git: 92ca4f92eca7 mwifiex: fix error handling in mwifiex_create_custom_regdomain -- Sent by pwcli https://patchwork.kernel.org/patch/9331337/