Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp739215pxb; Fri, 3 Sep 2021 12:18:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwFHQ6UgC8i/2o7luwDYX5WioCRSnBjpIJU8r3Y9MuL6Kxxf20u44R/UC2cCchl2SUTx8B X-Received: by 2002:a6b:e905:: with SMTP id u5mr399191iof.116.1630696711516; Fri, 03 Sep 2021 12:18:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630696711; cv=none; d=google.com; s=arc-20160816; b=qaKXk6Bqf49HzdncPzS5h5AdCX2SluNaAL10puyH/9krPuqmN7Xhn1TF4Q5m4u2LY3 LFtd3gKnRvJYIupHT2E1+YTZz8xmLQsbvYCJUr8dm4alQePfTVHijgY71D4i9irBkVxg XlOwTvWC8FLKYNY4eQSSbTERjG02ZrZ73NFP2b770hRo/BW4xQXvfKEqIZNv7bhK/obg wk9OrfDHtfGPqcgHAIZ0cL1h2g9sQmQdw3bdkvygIMCWCKxhes5IqQv8vKkgKfzayRLP JXOVkrDESHi0YqpTvELaLS4tRH7lJK1k9lL/9aoiZJHqiYvH7opVuvOD+Hb2NbRxZVhE 37bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cYg95UwxTL2wMWqBMmt8+HU/FFQUMY2wtY0M2szhJz8=; b=Ahunvy7AHUbtBsOREaZeridZr5nmlGX0/zBIVKHeP5XhUrdlD6CV0Ck4snqiY2JyGx mNm/NxgjoTRiulqcl1MbRtAp0+a1E7ac6I4z7zctwgfzk9nmKW0iYSzO6Y/Q71Sobln6 YTfuArpf87FRk/9Vi66g4om5r0x8uQUPXQievtuLK2vgBgEMDi3B3GvOayy8wNnWxsx1 3fXuMmrz3yWcTmF23ex/eyMFLPo3TbkJslpX1FDIrIyYeKOxc6y6kAPlBhC8K1bAGwQI qJwKw3o0M9msLWl/TogbalPOC7DY41pcQahmBJdjnzNT2PIqTXA524DwkBohOjW8TfYE bGEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@philpotter-co-uk.20150623.gappssmtp.com header.s=20150623 header.b="QIp/9/b9"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si143894ilc.72.2021.09.03.12.18.18; Fri, 03 Sep 2021 12:18:31 -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=@philpotter-co-uk.20150623.gappssmtp.com header.s=20150623 header.b="QIp/9/b9"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350944AbhICSyz (ORCPT + 99 others); Fri, 3 Sep 2021 14:54:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351186AbhICSyl (ORCPT ); Fri, 3 Sep 2021 14:54:41 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EF69C061575 for ; Fri, 3 Sep 2021 11:53:41 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id n18so84609plp.7 for ; Fri, 03 Sep 2021 11:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philpotter-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cYg95UwxTL2wMWqBMmt8+HU/FFQUMY2wtY0M2szhJz8=; b=QIp/9/b95JTMk9GYZ/8RlI4mVoQv4y2yt6N+yut/ximLGMu+tuqgZ16WFcVWV1mqGq fepqe7v2A20HFYssg1nO6q3PyQblDX7qDazWYNC3Pc4VhRasd1EvBTpM67pwafkmKzDG 8ZwaEw4euZAjKAjqzI5lRX4/sF1I7IIB4936jkCUQS49BrMluF7f8P0mevm9wlS7ku4e hqgcayKLbLvuVb/IOKLhAUOVhyk+g8yH4rXzxJUWxtaXS1b9YKwwWvnEEsSVj+yGWCeM /MQVfEbjm1zYGzx5w2DGXmIzOVBMQhysdwrnSbZKmhRZ5B1HpMAWs21lk0F51MSBhyYE Z3Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cYg95UwxTL2wMWqBMmt8+HU/FFQUMY2wtY0M2szhJz8=; b=YU5slN4ELsT2BlghOmtfh2T5PYpNuiFupuLBjzHJj9ES07ES0AOnMfj4OmLc3UlCXF ZS+N3gTAaTAfh8smLJGCc0ayat0+1zr+fVwY1sePjDyf5SXUpp5YGGJWTy1iktry2aLE xty47DXOdFB5CpNBRPnwv3cN+s1EDmHJLtoDzPPLmpsFQhZ7lO7GS4VfBBVQjL7jXSnv Opp42PfcjBmv8TSEgL38hTsfo57pOkUHaD9jlJTZjm24CnwFWEbJsq+sYyHF1okgIQvv QeaFqhq3W8CjnUbgWrfR6HvCF725a4ZT4Da05SwbU2NaxAzBOu94ykx5k6yxvKfG/bry PJuw== X-Gm-Message-State: AOAM530mDjHDePoocnawKE/6LNmYk/OQIlTEBTmIAzDTPuKzWkGtyqZZ /q6j++V7DsvGSqpLAcn3pswJHo1arO11zHalwMmUMg== X-Received: by 2002:a17:902:6b84:b029:ee:f966:1911 with SMTP id p4-20020a1709026b84b02900eef9661911mr224187plk.69.1630695220952; Fri, 03 Sep 2021 11:53:40 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Phillip Potter Date: Fri, 3 Sep 2021 19:53:29 +0100 Message-ID: Subject: Re: [PATCH] staging: r8188eu: os_dep: use kmemdup instead of kzalloc and memcpy To: Saurav Girepunje Cc: Larry Finger , Greg KH , Michael Straube , Martin Kaiser , "open list:STAGING SUBSYSTEM" , Linux Kernel Mailing List , saurav.girepunje@hotmail.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 3 Sept 2021 at 18:56, 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 > Dear Saurav, Looks good, thanks: Acked-by: Phillip Potter Regards, Phil