Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1132523pxy; Sat, 1 May 2021 04:53:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2r93pdmep7cMiWbhmFVRGgn10b2bD2Rg7IAvM8rRmeO/TcqqnZ5gbwQ9qqlSwQELvsu7B X-Received: by 2002:a17:906:2616:: with SMTP id h22mr8922918ejc.126.1619869988130; Sat, 01 May 2021 04:53:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619869988; cv=none; d=google.com; s=arc-20160816; b=zQ4SRo3GiE9urZaO3XSUHsC0zHtDSuDGijfo6Z5OGvsfB2DKZ0852hi4a8KBDE3S7c W/6e8uZ8K8sTzTVqYh3TI2WQRdv5Y+Vc1tIPl8ePGrZ17jvNVHTlpFDC0hYggXEPgQC6 bO0PUw/5eNEZxQniT8lHoGWsl/0rfYThxxwJkyNJjO0x5IhSb6LEgpJ/3cvMdMfY7qDq W4yl/FfUbD/pfPpeXUgRBIUSkLp8VMC/THHNcKT2YrwRKQavCTyryOfa2lfDm8Jzm1qJ tBC1+Jw3CEW3oC5EwqBFMMUC7uovAuWIApyj69YU48ueEnrlPYfIcYgs/locZ8fJeH/2 qfqQ== 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:to:from:date:dkim-signature; bh=V8Oh5UM+MuV4MLaFnRZfCDneLqfuPCQcjlq7Di+tmDk=; b=NH0b8kLRGWW/g9nDQev8mp1ZHUttNPTIgHzi4WFgr1/xiILMEiSr0dL3pdo6zb5+uv 2sE+/ShQdclPM+9E9/233zvRQa9aobNXGQk59vkbA+8xBWZoFZCR4iwOXsaEcWRHa31N 9W5uN8jIuq27E0Njr4bxCrmBX6mOn733RKeM6yn2dpA6Ddwmx6uicjoE45RHoKA3xFOE dUH1S7yb3zGYp9l3fg2/6yfeVHKNCDtR0fGKwx6QJUHmG+Rw2Gt9XpvV0hlEdkHbNtD3 jpsH+ozgCaGxuiplFLhcgNXznRBxqcuqWpP7dhsTPCtxru2KGAwvtTsXdH82pAvDWO9/ CPPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EiMn8cSd; 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 q17si6159441ejj.672.2021.05.01.04.52.44; Sat, 01 May 2021 04:53:08 -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=EiMn8cSd; 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 S232007AbhEALkb (ORCPT + 99 others); Sat, 1 May 2021 07:40:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231686AbhEALka (ORCPT ); Sat, 1 May 2021 07:40:30 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14E6AC06174A for ; Sat, 1 May 2021 04:39:40 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id p2so423070pgh.4 for ; Sat, 01 May 2021 04:39:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition; bh=V8Oh5UM+MuV4MLaFnRZfCDneLqfuPCQcjlq7Di+tmDk=; b=EiMn8cSdYzr7/++h6nLUN02El8BNKIJoyGedBJD04ih+UFfzoXNZKRXRPXQXPNfVus ZNb56g/H7yYSKP+KNArjMhke16K5nS0CI/NMvcphI71K9HNmMphIEU5KKfK2eECVmuK9 eaIE3LE6/vQgyGH3rv0dZGV7P6866rdD/FQNuRMlJSjLJZSeItMFv9z4eXH9mfpFprJ5 ArrFdeRhiBrShxbKOwSoWDrgVY/usDgIqLQDXFFCnY3chY0ocCwQtAA6+DZNJ5+fLwLi wFkiT2SlUNXt1fpyWNofd0HYqZJOKkVAw+JYGQhNLjqRHR7sgwh3osN2MTc92QsTBBX9 h4TA== 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:subject:message-id:mime-version :content-disposition; bh=V8Oh5UM+MuV4MLaFnRZfCDneLqfuPCQcjlq7Di+tmDk=; b=gePdNaL9G94pZ2Z83S3Y3chcjmJHUuu4DAoXYtaCrtqmwzctUSYOhh39g4CfVbtLDi K0w0vWd1muxcXlcPEqv90MPRnB76nX8Wet8Wiz7Zg+WILHOjfMA0LFtpwx2lfCjlP0Q8 fnJNXJim9uYODUXdx3RKKRlWdia3W9Q0tEVc+QFBj9JQRsUPYeOBpMaJtZ4NJ44CbLQU lUejheew9DO3CizrWLvYbJuh8ylMr+F6sQQrNP9tvtSN7c8r6tDQ9w+h53RsluJPJ8eX QGtakjSvFizf/ul10m82aZwd9+X3ounWYct809Ud1TDi4GPKF84HWriksAW5mGKr3wFW nMhA== X-Gm-Message-State: AOAM531WcshwPKWsyYCQo54pBjy05EPQO6FO1UqPCyg4mFKSBY9YwWLN CnsNjRPZSnjJRrnzh/TYiLY= X-Received: by 2002:a63:570b:: with SMTP id l11mr9009643pgb.193.1619869179376; Sat, 01 May 2021 04:39:39 -0700 (PDT) Received: from ashish-NUC8i5BEH ([122.177.225.134]) by smtp.gmail.com with ESMTPSA id x9sm5531489pge.55.2021.05.01.04.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 May 2021 04:39:38 -0700 (PDT) Date: Sat, 1 May 2021 17:09:28 +0530 From: Ashish Kalra To: Greg Kroah-Hartman , Ashish Kalra , Ivan Safonov , Abheek Dhawan , Andrew Morton , Waiman Long , Pritthijit Nath , Allen Pais , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v2] staging: wlan-ng: silence incorrect type in argument 1 (different address spaces) Message-ID: 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 Currently p80211knetdev_do_ioctl use type casting to req->data to prevent sparse warning while calling memdup_user, instead of type casting it here, its better to change data type for data inside p80211ioctl_req to include __user. Signed-off-by: Ashish Kalra --- Changes from v1: removed type casting of (void __user *) for req->data and corrected type for data to include __user. 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 ed65ac57adbe..77e8d2913b76 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 70570e8a5ad2..dfb2d2832830 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.30.2