Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2336009pxb; Sat, 28 Aug 2021 11:26:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0t923VRgWEQlGrC04wNkC9tnMtxebIF1mWOAb3dJm+m64nQyQ3i+R76PrSzvGvU8/EQJD X-Received: by 2002:a17:906:a991:: with SMTP id jr17mr5695759ejb.511.1630175180100; Sat, 28 Aug 2021 11:26:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630175180; cv=none; d=google.com; s=arc-20160816; b=sT0mwZSHXQ2M1ci1hsON+U10f1kNA5XSUC8G0tKZqQg+wiRLSPmBPu7vWzKmDycIAn XmexSRKfJOhgGkWNQk4DyqemETBFOP3SpwgTzW9gumX9T7V3hHDUdw7c15adLU4OKbp1 jaQNRlBDNgOml7majUQMAEwKiwoIqc7bFltE3vtaXiN/S3uOK9HN4s5URUHByN2pVyNY vZdFDPyR4O5JQQdp6C/RFx+voMxO0D9MHtCaSxCxqMPaTMLtkWQ26aHrvarKJtlpA2L+ NCf9sGpiI9YPV71ihcAJIP0pE7UiOaIJRu7wrG7Ek5HWUPyelHk1UY6xQykrNm4KfE04 BcfA== 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=QK06svqw7DyH5jd4WQQegPSwOLABf8o6RovqCiYy1aI=; b=Z+br11aaJc1zX5J6x/HdnL/U2Ianhx8gUzwwI+ZdHCOIcrmfDO85L3CBjqNZ+aQc+L muh27Ds1DyDiD48uDHJYZ0v1WAh/Tl6K/2OKlF+ndW1TNPDi4PNTj3bT/pxA0jiRuXGm sHp95/s2CAenLUolNmFxEQT3EVb6E6Dt22PJFgkc/DRwX7XOsCJ+m8v1LVcX+lewRVj5 TxOP9kK0jSZdGsnjrn5rqZW8TJNzIqquvFstm9q930viCHs8rtju1ZlQBVD5/lAIuRmD USOY8kzMAI38c8fJhv+qs7lmHOddEUM1fHZ8zTf3ptM8bzetMU6MSHXwbNa4kzSFm6BF LgKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GdDcYUUF; 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 22si6439122ejw.427.2021.08.28.11.25.44; Sat, 28 Aug 2021 11:26:20 -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=GdDcYUUF; 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 S230014AbhH1SSt (ORCPT + 99 others); Sat, 28 Aug 2021 14:18:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbhH1SSs (ORCPT ); Sat, 28 Aug 2021 14:18:48 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6DF2C061756 for ; Sat, 28 Aug 2021 11:17:57 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id j2so6111290pll.1 for ; Sat, 28 Aug 2021 11:17:57 -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=QK06svqw7DyH5jd4WQQegPSwOLABf8o6RovqCiYy1aI=; b=GdDcYUUFcu40LOvVrFSUSjOdct8TJvYCny7rpi0ZRkFSVfR/5k0QoFQ4ka2tosX2mD /LvxPxJFXR/6FBmbVowLEe3MoVk8rOA1LQwvPCZpBIUbfJwYBhBkDKdfNfuHMqrHwqv0 zBjOfRpyG4pyyBLu8mukkVE2CPpPe6castqRRG9OXFo2srraiomilfK74Cb5C6+Njpvb ZtnBOWZz0eGTHk6NhfRRCPwE2zoGCkXdUYX50rOi3G7x+LMi9WPAUqmDZiCvrID3/iTS e2HhcO6A4dJiEdT1aIa7Qvdf/orpoBMCmS1iINujGR2p2pAK48gN5GVZfZgHX/dxxL65 PpVQ== 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=QK06svqw7DyH5jd4WQQegPSwOLABf8o6RovqCiYy1aI=; b=jSEDegtCXXi4YI+3tbKZfKidNWBJOG3tgRY0yFCZ6cxb6/tsD9kC9KL/lhQrNKtexe vka9RFLJ7Qsw0+eivFfGOG53fr/KR5algMI9KR7DMRnDdSJFxHys8D/Jnra5IJ1wXYex P7gmlRI5Cak47CuhiLw8U/iS9pTxRO2FCLpEr0vp/jAQ9mvwUFV4Us6FJR2Q3AAKzyLd pYwGuLMPFn0N8fwP+b6WNsL6NyeAMLo7MjRw/j9kx4je2QyiYW3d/iwK+xgglf0M0Z3S EVrlgkMISxfYQRZgs+t9DSF4lLkNQOUyDGw4Bp0D/634zPqnX0/EZOP0uBFz1aZXYjUe z62w== X-Gm-Message-State: AOAM532bQt+SW26f8HJLYON7azns5JXuGkvFzrsdadw+J6oxxgYPNgn5 Ttn639HfU+29oodwfWF1MxvqoRjKijw= X-Received: by 2002:a17:902:ed82:b029:ef:48c8:128e with SMTP id e2-20020a170902ed82b02900ef48c8128emr14366631plj.72.1630174677122; Sat, 28 Aug 2021 11:17:57 -0700 (PDT) Received: from user ([117.98.200.228]) by smtp.gmail.com with ESMTPSA id c16sm10196931pfb.196.2021.08.28.11.17.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Aug 2021 11:17:56 -0700 (PDT) Date: Sat, 28 Aug 2021 23:47:51 +0530 From: Saurav Girepunje To: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, gregkh@linuxfoundation.org, straube.linux@gmail.com, martin@kaiser.cx, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Cc: saurav.girepunje@hotmail.com Subject: [PATCH] staging: r8188eu: os_dep: use kmemdup instead of kzalloc and memcpy 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 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