Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp211443pxb; Thu, 2 Sep 2021 02:23:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzD2gYgJZPVUMvQSn75xRetSnAYNC1Sjg+dft34B5xMJXLwmxxVfY9bI0C6kBjnEEO6OMt2 X-Received: by 2002:a5d:8715:: with SMTP id u21mr1936673iom.1.1630574606289; Thu, 02 Sep 2021 02:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630574606; cv=none; d=google.com; s=arc-20160816; b=oAnlqcibndOuIN3dFF0/Pkc7/OmmRS7TQp/yCt5rMNY0nV2qmJ6J96OatREQojTz/0 aXkhjFu7+R1444b7TieOdCC7pGDcKHaDdDj956kBqo8AS9Rq7/P1T3IP80QXHzpA0Tz3 7u4IZhXVYowEtPKrrpN/m9ugt5z/l7B4eyhpaRzRNo45hXpWAuzV1UFW+gw3WoB42Ifs Aerf1O6lD78/Hc6CZytrnhBIXuDJxmOG0qp2N2nOYNlywrUfmevpx0iDLjUUTRJbjkLx 5J/fyaF7qJmzn9gR7C02UWKcROXOPUhH6DmZNcnGakwdcrCWpR0/upCdVh8vKfeplc/X zEEg== 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=zLErNoEur2wFdOxJAms+OPa3542OW5XoP0hGGudZgJM=; b=ZeDFXZk9T33h8vxxbbXDBzYK14v++Clsqc27UWgycd0pGtptNfT4ro6UghveBw6irB OsodwYU9PmDKI87PWxTTro+PTx3EIOIUTQNCjH72iDmieRsupfBNjF6g0oftXhia2xS+ 7LyibUWZ31QETLNL+24+s+EP+TqCCieigDIL3ckykhTXeISs3E59nB4jPx+izLHP/bKH D+MMOWma1rpFIYcJnXKZYzqVrfKzcC6lnR+1PTHmDbkucvvEhNZXsZqq3Zc9ENyd4k1n sxcC0n8iavBwMVk+7t19YUYnfmDhb5XOQX24wjB5IrNnvV0q8gy+dTwIk0GAXCvIiKaF wYkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OIP+QkNr; 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 x8si1615827iom.11.2021.09.02.02.23.14; Thu, 02 Sep 2021 02:23:26 -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=OIP+QkNr; 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 S245233AbhIBJWG (ORCPT + 99 others); Thu, 2 Sep 2021 05:22:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:47346 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244800AbhIBJV5 (ORCPT ); Thu, 2 Sep 2021 05:21:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2777960F6C; Thu, 2 Sep 2021 09:20:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1630574459; bh=Q2uYr1StgndRxWJ5vI83t1KnU1e0/MBW/UEtfaBfT8w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OIP+QkNrbd8Sb9tSGQg/GS2C8xuDV0VPA2aZiKGuLQ/3mtyZoPB4hZBhW7ED/i81m ty5/bxVjc0IJZXGurW4oqKTny0uvjIXZnIxRVZkeKruzbsoaAphl5fZ5PMs+bYanqn XE0mq6DFZFCaKPCOdVlj8Zq2nlUqKMt0M461P0Zw= Date: Thu, 2 Sep 2021 11:20:57 +0200 From: Greg KH To: Saurav Girepunje Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, straube.linux@gmail.com, martin@kaiser.cx, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, saurav.girepunje@hotmail.com Subject: Re: [PATCH] staging: r8188eu: os_dep: use kmemdup instead of kzalloc and memcpy Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 28, 2021 at 11:47:51PM +0530, Saurav Girepunje wrote: > Fixes coccicheck warning:WARNING opportunity for kmemdup in ioctl_linux.c > > Signed-off-by: Saurav Girepunje > --- > drivers/staging/r8188eu/os_dep/ioctl_linux.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c > index 81d4255d1785..495fadd2b8c8 100644 > --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c > +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c > @@ -585,14 +585,12 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie > } > > if (ielen) { > - buf = kzalloc(ielen, GFP_KERNEL); > + buf = kmemdup(pie, ielen, GFP_KERNEL); > if (!buf) { > ret = -ENOMEM; > goto exit; > } > > - memcpy(buf, pie, ielen); > - > /* dump */ > { > int i; > -- > 2.32.0 > > This patch never showed up on lore.kernel.org for some reason. Please resend and see if it was a mailing issue on your side... thanks, greg k-h