lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171125044014.lfdwsrfgl4dz725d@mwanda>
Date:   Sat, 25 Nov 2017 07:40:14 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     ishraq.i.ashraf@...il.com
Cc:     gregkh@...uxfoundation.org, himanshujha199640@...il.com,
        goudapatilk@...il.com, insafonov@...il.com,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
        Johannes Berg <johannes@...solutions.net>
Subject: Re: [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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ