Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4562458pxy; Tue, 27 Apr 2021 07:50:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWOYhG0Qr2Cw6n8O2ZG+q7RIkDqSfZOB3AKo8G807KHXEXOebZBUwIFwH2WsmQDi3bRzAF X-Received: by 2002:aa7:df86:: with SMTP id b6mr4876605edy.27.1619535005712; Tue, 27 Apr 2021 07:50:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619535005; cv=none; d=google.com; s=arc-20160816; b=vJw70MTGBQMt26cKLT6AYobQxJbcmNCYqsZxXcgjbMI0d76LhEdpksYfVkZmnprzpT Z5nFgmhVHBSMZfIvWlIFZDYbj5awCR2wI9+N9+hlSfLi0vaeSCCZRaxfZ/eNxm7ZZ4l5 HWj5ZErMeZfFfUXzfGDyHq1hydIdYp5dLwLmaO4FAjOoL17z2Srjf3tj30DZRoCaEEm0 wZQG8neCPZj8iBBE+Z0cFeoIoDFMP3UvD27bKP4fjP/10ym/uQNsaiiLo1cujzubCs0I 51+MGjN908sfp2pb7/nWh7S23iwtqZjwNyD9HzuLaADs0uFdC4wXTldYqik1sipMaKRR KkmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=2xFujiKNAg6k8WiwS+GsUKGoyhfviAT6MrFMuV7g0VY=; b=XZXbImJvLBF5PgLivkoTGm/SEpMDCk0A4J377rl24md02Hni4N99vqqY0+KyLxdRmG JhGIcHpt8IVng8zxCSjJFlKyiRzPtmQtVMze8Y0abMb9y/Z7N2ITS18h1ygURS4rNzlY 25b0t4UZ57jbnHUB/qdBTka5MAP6rDPV8KOr3J/i1NeD2z4OG2FFsW57kgA0Lj1tEZWz TA88hzZnuX5FG0PpouvgEXHgqjmPZxvFoKvHOTVld2ufYzNvjN3HDjNqN/4m5oHyv9fM M7QQ4GG5gg69g9X9Bz/ukGluI8ka+8YY5WA6mCqSJb4DEcevPxCjjEG0Q7y4/bqBLffX njMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="W9bX/yQR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s1si2675460edy.160.2021.04.27.07.49.40; Tue, 27 Apr 2021 07:50:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="W9bX/yQR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236495AbhD0Oqs (ORCPT + 99 others); Tue, 27 Apr 2021 10:46:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236144AbhD0Oqr (ORCPT ); Tue, 27 Apr 2021 10:46:47 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 886DCC061574 for ; Tue, 27 Apr 2021 07:46:04 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id j6-20020a17090adc86b02900cbfe6f2c96so7350065pjv.1 for ; Tue, 27 Apr 2021 07:46:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=2xFujiKNAg6k8WiwS+GsUKGoyhfviAT6MrFMuV7g0VY=; b=W9bX/yQROiVEU3xK/9vtl2mZLT98Kf4hlhcJHT17XauZB0OobUBtWOaqq8wJa1NlXQ ib1BezYVzqVtSsChKSGdWHq1fNK9XeMcnvEdY+Ol//OwKa6dqE/gqrJ2O3UkY7ydHHzd 4rnD+QGh3SAnIj/tzAFpm+hitGY0bug/yVgHKumed7qHGCmP6KOhxV1S1ecFZMNmDvjV sIZ5Suh9mvggueaJ8s+V8VVdClx1yiuxnqohMQuqlQRarT9y6RioOa7u7lL0GVK/P9/e yrzjO1nMMmMMz/+wH0L1mY7OVQ8k1SEDilBi34w5HTlOtAd5C7CsOvmcRKUbeXZ8+6Xo 6jTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=2xFujiKNAg6k8WiwS+GsUKGoyhfviAT6MrFMuV7g0VY=; b=cRxSTeJBDymqXvVmWTz9Rm/XJod1/g3GpfTxwYAPMg7OU+/b9nrhX51wUwsTCDTCpe kY7YsUFEcPxyI6vOvRzm2Q2fmcac+sr/mj378YnKkA5LdtaNS3xKwGJTmW5/Wj5/2ESq cDwY05hmoa5Um0t2mt/l8GOTUeTio1pJBPun2S2128FQUfg7TL61y0ssqvlW+4Y5Blq3 T0O+mAhd67ypU+0oDQB9zzZeFirGYJl49R4dYpSeIjlpnhPxl/FbOJ0bY/7vyxEUsSjV QSG010ogx/uKpEXP6m4/+Ts82JuEW157CVKkhOEs+O3eWSrN5QNFjviNi9aub7NuYWGL Dljg== X-Gm-Message-State: AOAM531GczaxhylVSa/uXKqmA7xhm1RsK8dVVkwFVLQU0j4pSk0GMDjB nDOMszm02ufhSlEi3DkNLgDFXOSeUSG6WpUL X-Received: by 2002:a17:90b:3686:: with SMTP id mj6mr5330388pjb.116.1619534763867; Tue, 27 Apr 2021 07:46:03 -0700 (PDT) Received: from ashish ([182.77.14.23]) by smtp.gmail.com with ESMTPSA id o4sm2838199pfk.15.2021.04.27.07.45.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 07:46:02 -0700 (PDT) Date: Tue, 27 Apr 2021 14:45:56 +0000 From: Ashish Kalra To: Greg Kroah-Hartman , Joe Perches , Abheek Dhawan , Johannes Weiner , Romain Perier , Waiman Long , Allen Pais , Ivan Safonov , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Cc: eashishkalra@gmail.com Subject: [PATCH v2] staging: wlan-ng: silence incorrect type in argument 1 (different address spaces) warningJoe Perches , Message-ID: <20210427144556.GA19024@ashish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Abheek Dhawan , Johannes Weiner , Romain Perier , Waiman Long , Allen Pais , Ivan Safonov , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Upon running sparse, "warning: incorrect type in argument 1 (different address spaces) is brought to notice for this file.let's correct data type for variable data adding __user to make it cleaner and silence the Sparse warning. This is version 2 of the patch, version 1 can be found at https://lkml.org/lkml/2021/4/20/203 Signed-off-by: Ashish Kalra --- drivers/staging/wlan-ng/p80211ioctl.h | 2 +- drivers/staging/wlan-ng/p80211netdev.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wlan-ng/p80211ioctl.h b/drivers/staging/wlan-ng/p80211ioctl.h index ed65ac57a..77e8d2913 100644 --- a/drivers/staging/wlan-ng/p80211ioctl.h +++ b/drivers/staging/wlan-ng/p80211ioctl.h @@ -81,7 +81,7 @@ struct p80211ioctl_req { char name[WLAN_DEVNAMELEN_MAX]; - caddr_t data; + char __user *data; u32 magic; u16 len; u32 result; diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index 70570e8a5..dfb2d2832 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((void __user *)req->data, req->len); + msgbuf = memdup_user(req->data, req->len); if (IS_ERR(msgbuf)) { result = PTR_ERR(msgbuf); goto bail; @@ -579,7 +579,7 @@ static int p80211knetdev_do_ioctl(struct net_device *dev, if (result == 0) { if (copy_to_user - ((void __user *)req->data, msgbuf, req->len)) { + (req->data, msgbuf, req->len)) { result = -EFAULT; } } -- 2.25.1