lkml.org 
[lkml]   [2017]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] staging: rtl8188eu: Fix private WEXT IOCTL calls
Thanks for doing this.

This needs to be folded in with the earlier patch you send and then
resend it as a V2 patch.
https://kernelnewbies.org/FirstKernelPatch#head-5c81b3c517a1d0bbc24f92594cb734e155fcbbcb

I added Johannes to the CC list again because this is sort of his
fault... To be honest, I'm a little bit puzzled. I would have thought
Johannes's change would have made some code unused and that we could
delete it now. I haven't looked at this.

>
> - if (ret == 0 && (copy_to_user(wrqu->data.pointer, param, wrqu->data.length)))
> + if (pmlmepriv->htpriv.ht_option == false)
> + psta->htpriv.ht_option = false;
> +
> + update_sta_info_apmode(padapter, psta);
> +
> + ret = 0;
> +
> + if (copy_to_user(wrqu->data.pointer, param, wrqu->data.length))
> ret = -EFAULT;
>
> - return ret;
> + err_free_param:
> + kfree(param);
> + return ret;
> }

Please keep the success path and failure paths separate like I did in
the example code that I wrote in my email. Don't indent the labels. It
should look like this:

update_sta_info_apmode(padapter, psta);

if (copy_to_user(wrqu->data.pointer, param, wrqu->data.length)) {
ret = -EFAULT;
goto err_free_param;
}

kfree(param);
return 0;

err_free_param:
kfree(param);
return ret;

regards,
dan carpenter


\
 
 \ /
  Last update: 2017-11-25 05:41    [W:0.091 / U:5.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site