Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1920240ybh; Sun, 15 Mar 2020 14:30:40 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv0j9cLyvlPSTI2z8nmZdwDtQH1E2DDSG3qvlHGTk6tCi97KuWpinPLaG3EPf9j9znxEo6o X-Received: by 2002:a05:6830:1e06:: with SMTP id s6mr9474145otr.28.1584307840057; Sun, 15 Mar 2020 14:30:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584307840; cv=none; d=google.com; s=arc-20160816; b=fDUXpeyn6pKSytRYxdgW4aDwKzHhPtWEUq2XyQXhULjBfXlN9DJBxmTSq4b2CiiyAj ZrkJ3s4Fe6bJapCl9bPPlew36hj/PZbQ1/Obq6DL64E5M0lxcujrleGlRIjhi6mB23wV D+v4LGTtERcLYx08ws9GFVPmlJyiISfkhoWn4wQmqekOkvWpzk151F/r23esGJhH8OFg 3a+Di3wSzJP+feyzFivfViYMeONu+Q59FP3HPamU4PciETUhdMJ51xN9rxyIWCRDYYCH mnO51BL4HUhYJVRCOPjAYswATo0u3wgWqZSWNRGhGr5u/AutOzUuYnTrwWF9mMe7Ee9V F3tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=nCZjjXhZtIZTco2GVuY9U8dtD4rKbgr/KTIhT3OsK/I=; b=afp/NvbqafDVu27kaTPv02x1pywpMjhtU09EhcF4DBFV/aoJWu9ZyFy1QcgH6hvBxu ctoVOoDwC4BT42bcLFHFjhx+RkIufjOgCX9geQdbNv9uXXewDxJ/bxmPJZptRgYd/4mE qOi4jgXPEP2EKy4c3b+/tM1XF3XtinHpWqAHNoJKvLn/1OJrkfTMj5yVbRCLyC/9LrZC CMtgi5BO/o0HIMPEIjX6tUrQvPVd5IZZZ1Zf//lIy4HBRKzJyWLPvplyAQXohNh5vY4d YAYzo6XUcp7MsC3CuuCRCpGMKw5wR+AjTIB3zAXOifVzgaH9KKdrnE3LR6VveQduZG/a uOIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MTniCmoK; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9si6459252oig.174.2020.03.15.14.30.14; Sun, 15 Mar 2020 14:30:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MTniCmoK; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729235AbgCOV37 (ORCPT + 99 others); Sun, 15 Mar 2020 17:29:59 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:31068 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729202AbgCOV37 (ORCPT ); Sun, 15 Mar 2020 17:29:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584307798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nCZjjXhZtIZTco2GVuY9U8dtD4rKbgr/KTIhT3OsK/I=; b=MTniCmoK8te0pj45YyeqTCV3YSQ5yLUYxEuonWQv263mTR4lQv+A9e28nIRp49NFs02EsV 4oHNqPvN4AhVRUmESBZEiGQXEOp1gDEC65jg8Vizu8Ypt4sm7W/9Ff8cqTM1DAnkTYcT+n bHibl88nLQlYqmTS3K0huKNTihQFD34= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-476-4bSSCoquNZ2P3989GY5_Pg-1; Sun, 15 Mar 2020 17:29:54 -0400 X-MC-Unique: 4bSSCoquNZ2P3989GY5_Pg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E82BA800D50; Sun, 15 Mar 2020 21:29:52 +0000 (UTC) Received: from elisabeth (ovpn-200-18.brq.redhat.com [10.40.200.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B737B60BFB; Sun, 15 Mar 2020 21:29:46 +0000 (UTC) Date: Sun, 15 Mar 2020 22:29:38 +0100 From: Stefano Brivio To: Shreeya Patel Cc: adham.abozaeid@microchip.com, ajay.kathat@microchip.com, linux-wireless@vger.kernel.org, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, outreachy-kernel@googlegroups.com, daniel.baluta@gmail.com, nramas@linux.microsoft.com, hverkuil@xs4all.nl Subject: Re: [Outreachy kernel] [PATCH] Staging: wilc1000: cfg80211: Use kmemdup instead of kmalloc and memcpy Message-ID: <20200315222938.23a9faec@elisabeth> In-Reply-To: <20200313112451.25610-1-shreeya.patel23498@gmail.com> References: <20200313112451.25610-1-shreeya.patel23498@gmail.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Fri, 13 Mar 2020 16:54:51 +0530 Shreeya Patel wrote: > Replace calls to kmalloc followed by a memcpy with a direct call to > kmemdup. > > The Coccinelle semantic patch used to make this change is as follows: > @@ > expression from,to,size,flag; > statement S; > @@ > > - to = \(kmalloc\|kzalloc\)(size,flag); > + to = kmemdup(from,size,flag); > if (to==NULL || ...) S > - memcpy(to, from, size); > > Signed-off-by: Shreeya Patel Reviewed-by: Stefano Brivio -- Stefano