Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1277686ybi; Sun, 16 Jun 2019 01:18:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4fV245GuUPM2oiyld28VN0Tf8Tz0UCkAHKtrMt6GtF+U7anBDBuw8ZDmuvox1Hy92bDL7 X-Received: by 2002:a17:90a:cd03:: with SMTP id d3mr19188965pju.127.1560673130073; Sun, 16 Jun 2019 01:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560673130; cv=none; d=google.com; s=arc-20160816; b=xIYk+dkoVweU5bB1Bzcjn7b+nlnoG0lXXHFp5GCpjzEhMq3u+kgrkuvOQ9cBnKpBa8 aWT1eZj7ltEQzGYeCyG+sWVuyx2odVR7Rq1HtnR0Ue36i2qkVfbXiDh+6VXoQHn2S+6N Lu4vN2s7/ucXH5LXNW7qaBqK5qz438rwRsUJ2xCjCuTgmJ3dugjKeY+y0u5uBr9zLfGQ ZSpfQ3WKHId3Y02GEiX9VAkNWItKF3k/ZZpA32YUrnwCUeELaMvUL61Tm0eZnhnguoPq ojtsl8WEtykXr7IofJuIOT7ATtx9UNrh7j7dXxpH30nkv50mZyRwAEstfm49je/+EuY6 mdWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZJ73kpbrHeloQJUvQyeOr5ZclVGIW1bQHglprF2krOA=; b=d7v1C4X1wFktOaqBdjmrUCPtKelVoQS9WW+BB08fcHcQWR9nQBvg9ID4m53VuvlX24 O0L4c0Gxo4x/WtnhskFSZWKQqrBdU6CPNMWT/tTbstfwuNm64jcN0Cfuq2nmqn4X3WtV G+M4dUnRjqzP2jPZYqWoWpZMhxh3r6cywlircCQwh0mj7XRatNvh4uzPHvsIO/po8q9+ fTjv3sRbqSWyLeSQNFgWY912zKxOyv3iKjjXoDAsm1yTV+fWrDR1G9Wq4gTb38H8Mw6T G7CjCpwDWUkt5d6aHi5cyjqPZzjx5c7kD4iW8HbEmb4fmY0Blp23AWd2JrZwVcB/aiiT KNoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=LfBi3iw0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4si6819300pls.391.2019.06.16.01.18.34; Sun, 16 Jun 2019 01:18:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@oracle.com header.s=corp-2018-07-02 header.b=LfBi3iw0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726120AbfFPIRx (ORCPT + 99 others); Sun, 16 Jun 2019 04:17:53 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:39740 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725865AbfFPIRx (ORCPT ); Sun, 16 Jun 2019 04:17:53 -0400 X-Greylist: delayed 3609 seconds by postgrey-1.27 at vger.kernel.org; Sun, 16 Jun 2019 04:17:52 EDT Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5G7G136007380; Sun, 16 Jun 2019 07:17:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=ZJ73kpbrHeloQJUvQyeOr5ZclVGIW1bQHglprF2krOA=; b=LfBi3iw0+y+4oMsKxIkJu47SN+x7kNaFUa5x0QPMv4EXR3JRk2QQ8m6TopfNTuia9Nwq 3n2VyngRvRspByxMmh1FKfbsjNOgyP7MLete8irNCKAHR96M1obAj9cG8ibDBjyXygqP 0etlt4szoKCZict6/j4Ie+Y5p6LDLUg1+ttQ4n2YXmqfesapdYH8xj9wn50uuAY3+7/z kac1gsttcZPu6aeVnnN7+VPiBa94mX2fUtnYBYwCNm9s9n83m1VePSJwR6NtREKWc+Up CRNTSDm1jC5C4m9fhTIgb1zGTHGsdceBxBYOKGmGZV6SsoWgQKzAsSYphU2kwzyNtikT kA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 2t4rmntasp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Jun 2019 07:17:37 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5G7F6UR093492; Sun, 16 Jun 2019 07:15:37 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 2t5cpd1ws9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Jun 2019 07:15:37 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x5G7Fatt023361; Sun, 16 Jun 2019 07:15:37 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 16 Jun 2019 00:15:36 -0700 Date: Sun, 16 Jun 2019 10:15:22 +0300 From: Dan Carpenter To: Hariprasad Kelam Cc: Greg Kroah-Hartman , Michael Straube , Mamta Shukla , Shobhit Kukreti , Emanuel Bennici , Puranjay Mohan , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: rtl8723bs: os_dep: ioctl_linux: Make use rtw_zmalloc Message-ID: <20190616071522.GE28859@kadam> References: <20190616053250.GA16116@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190616053250.GA16116@hari-Inspiron-1545> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9289 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906160070 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9289 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906160070 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 16, 2019 at 11:02:50AM +0530, Hariprasad Kelam wrote: > rtw_malloc with memset can be replace with rtw_zmalloc. > > Signed-off-by: Hariprasad Kelam > --- > drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 12 +++--------- > 1 file changed, 3 insertions(+), 9 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c > index fc3885d..c59e366 100644 > --- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c > +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c > @@ -478,14 +478,12 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, > if (wep_key_len > 0) { > wep_key_len = wep_key_len <= 5 ? 5 : 13; > wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial); > - pwep = rtw_malloc(wep_total_len); > + pwep = rtw_zmalloc(wep_total_len); We should not introduce new uses of rtw_malloc() or rtw_zmalloc(). They are buggy garbage. Use normall kmalloc() and kzalloc(). regards, dan carpenter