Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp277596pxy; Thu, 22 Apr 2021 01:46:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx+7Z7LwBWMd0vcDhOQ8dN0n2F+5WdwGUtztXDg3+DaqeUPIioVPtyd8+Ike60bJSUX7j8 X-Received: by 2002:aa7:d14a:: with SMTP id r10mr2403057edo.385.1619081166464; Thu, 22 Apr 2021 01:46:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619081166; cv=none; d=google.com; s=arc-20160816; b=vmWs4zqhKdza4In31I9sWxDi5bjMUwLharjeWOLbZ3xZDT1ZTP3QeC7/x7bEQQoHOs OMivRNxA9+AwuUro2CDfYUSDxdnYwTT4NiRoeiVb263V+INuFNhPOiRCEbz2gtD1gmpQ RHLOqKdYbrYkw0yj2zW4yesEU32sr5UXzy8O/ykXjriByfApcH1MGvfmCQhji8bLeGCJ kjjsYOll8oJAhUStit75wQ+rpHH1euTaVGbxorKKHbqS3EGYi4IYqYL/Oy5nuTjHOzc6 LGqSjaDPASmF73f7JpzvUZ0kiZza89uWUkuXboPMgY3bys193IM6oyNcHnoi61tJ+uzK 8Uew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nZIpf8DOVT4zMK346DrV4e+FFkhFlAvCSyEsR/LO3ZU=; b=Xye45fjvYyQNlQ9TfA2pzg6l51I+sUDedVXPu0Mmsdp4yUr1PrlcK99pG9y24ovP3Y LzK9x76bcXhEUBnIz8ao9QjkxvyZ7UUfCCvnKUifWnlG6D5Dng33MDOgl/RTWOdppX5y HB5thRW17aUQX+/6LEk2vt4rIWCD4SiwmV31eGWRNKvrnFNVVCF2E2TTU2rZsOejkiQA 9iUQwJZJ0E4yUt8knM0zJ4dwUMqamzpPYStWECM3yN7IuXeOCI59Z53Keu9PtOhGHeVH eVk6zZQ79zNK4Q0pp80AahAc1YkYhk67iOKuzub6egaRdjIOjPhfEAb/ZQenwxHVtGfF fa+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tZC57jpC; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nc31si1638775ejc.680.2021.04.22.01.45.42; Thu, 22 Apr 2021 01:46:06 -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=@linuxfoundation.org header.s=korg header.b=tZC57jpC; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235540AbhDVInw (ORCPT + 99 others); Thu, 22 Apr 2021 04:43:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:60188 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235156AbhDVInw (ORCPT ); Thu, 22 Apr 2021 04:43:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EDD1461426; Thu, 22 Apr 2021 08:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1619080996; bh=doOimx+KZm3Jwz7JUFrZDjSx/2XdjrMNoBga2za7QLA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tZC57jpCX0UhevlgvfIB2H2yaoXP4U6C8WLYMEMYNShRO3noMWOKMbdSVFVjsIYns LZmlNTA4Uz2bMNmdRjVbPEi6xNaV0EZ6sgQh+5ZktUcTIsja4YIZR+mfDXFQs3wI+D u9Y/YXC6kIsFT8Ie/Vix6ZC199Gciq7DW8s2zyPI= Date: Thu, 22 Apr 2021 10:43:13 +0200 From: Greg Kroah-Hartman To: Ashish Kalra Cc: Abheek Dhawan , Johannes Weiner , Romain Perier , Waiman Long , Allen Pais , Ivan Safonov , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: wlan-ng: silence incorrect type in argument 1 (different address spaces) warning Message-ID: References: <20210420090142.GA4086@ashish-NUC8i5BEH> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210420090142.GA4086@ashish-NUC8i5BEH> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 20, 2021 at 02:31:42PM +0530, Ashish Kalra wrote: > Upon running sparse, "warning: incorrect type in argument 1 (different address spaces) > is brought to notice for this file.let's add correct typecast to make it cleaner and > silence the Sparse warning. > > Signed-off-by: Ashish Kalra > --- > 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); Why isn't data being declared as a __user pointer to start with? Why is the cast needed here? This feels wrong as if it is papering over the real problem. thanks, greg k-h