lkml.org 
[lkml]   [2021]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: wlan-ng: Fixed incorrect type warning in p80211netdev.c
On Wed, Feb 17, 2021 at 09:12:55PM +0530, Pritthijit Nath wrote:
> This change fixes a sparse warning "incorrect type in argument 1
> (different address spaces)".
>
> Signed-off-by: Pritthijit Nath <pritthijit.nath@icloud.com>
> ---
> drivers/staging/wlan-ng/p80211netdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c
> index 6f9666dc0277..70570e8a5ad2 100644
> --- a/drivers/staging/wlan-ng/p80211netdev.c
> +++ b/drivers/staging/wlan-ng/p80211netdev.c
> @@ -569,7 +569,7 @@ static int p80211knetdev_do_ioctl(struct net_device *dev,
> goto bail;
> }
>
> - msgbuf = memdup_user(req->data, req->len);
> + msgbuf = memdup_user((void __user *)req->data, req->len);

Probably the correct fix is to just change the type of
(struct p80211ioctl_req)->data from caddr_t to "void __user *data;".

I haven't looked at this though, so double check.

regards,
dan carpenter

\
 
 \ /
  Last update: 2021-02-18 15:01    [W:0.127 / U:1.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site