From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCC65C4363A for ; Mon, 26 Oct 2020 09:45:47 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 66D2F223EA for ; Mon, 26 Oct 2020 09:45:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="V2N+/FzK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 66D2F223EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 25A162E0F2; Mon, 26 Oct 2020 09:45:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fqyql5wBymga; Mon, 26 Oct 2020 09:45:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 07AEB2E0E9; Mon, 26 Oct 2020 09:45:44 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 0EE801BF48B for ; Mon, 26 Oct 2020 09:45:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0B92E86135 for ; Mon, 26 Oct 2020 09:45:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QUUQxoAYmf8Q for ; Mon, 26 Oct 2020 09:45:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 88F3F860DE for ; Mon, 26 Oct 2020 09:45:42 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09Q9SQe3023049; Mon, 26 Oct 2020 09:45:42 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-2020-01-29; bh=uqhrAdg3TfmevqiVljqGouwdkFT25FCvvNohZL1rOVU=; b=V2N+/FzKrkMVsGNKfi49L6L0b6p8fc/w9VfnIOU63WO1qTzZQ7iQvpNhq9x9xOmv5LeQ eT2XXmFlmub//oQ0g+2plryU12hCGtTIGFMVyoWbBGvrgo/fznMvADg3yJ99nqo2PBQl RL7VZX4adNzry4htFbWEofT4uVMPzzfVa7VQZVV3C1TLIC0U+OD2Gf1Csjxw1AjYV0I1 OMSKiNbgOgp915qcZjR1S9+COtTQ8pP4ZHxgylqJkeyYjx2BB4V559h1LBoNTZOEJG8x Irlk2C1eO+gloJPTsU3IVfUu3YPEEDCA4W25/ULZJDIXBDLmYkf+sDNeDO4uDEfGSDnK Vw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 34dgm3sd0y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 26 Oct 2020 09:45:41 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09Q9VEgD083368; Mon, 26 Oct 2020 09:43:41 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 34cx6um208-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Oct 2020 09:43:41 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 09Q9hdGp003086; Mon, 26 Oct 2020 09:43:40 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 26 Oct 2020 02:43:38 -0700 Date: Mon, 26 Oct 2020 12:43:33 +0300 From: Dan Carpenter To: Elena Afanasova Subject: Re: [PATCH v3] staging: rtl8192u: ieee80211: replace kmalloc/memset with kzalloc Message-ID: <20201026094333.GJ1042@kadam> References: <43e637becf35f98a952c38ee1a5b690798c62c75.camel@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <43e637becf35f98a952c38ee1a5b690798c62c75.camel@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9785 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxlogscore=747 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010260068 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9785 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 impostorscore=0 adultscore=0 bulkscore=0 spamscore=0 phishscore=0 mlxlogscore=764 suspectscore=0 clxscore=1015 mlxscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010260068 X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org, outreachy-kernel@googlegroups.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On Sun, Oct 25, 2020 at 10:54:31AM -0700, Elena Afanasova wrote: > Replace kmalloc + memset 0 by a call to kzalloc which zeroes memory too. > Found with Coccinelle. > > Signed-off-by: Elena Afanasova > --- > Changes in v3: > - use array_size() struct_size() is more correct than array_size(). If there were really a danger from array overflows then array_size() would not prevent it 100%. There should probably be a static checker warning for when people do "expr + array_size()". If you're looking for something to write, that's an idea you could implement with Coccinelle or Smatch. regards, dan carpenter _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel