Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2309256rwb; Sat, 19 Nov 2022 13:11:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf7GQl2jjVdj3fKzEdc+0GAITOuD+JhsjNveVS4lPbsJ2ckjSd5nP9H9Ciw5rdT0IXDOwouV X-Received: by 2002:a17:906:4904:b0:78d:6a9b:216c with SMTP id b4-20020a170906490400b0078d6a9b216cmr10471834ejq.602.1668892317785; Sat, 19 Nov 2022 13:11:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668892317; cv=none; d=google.com; s=arc-20160816; b=ve/dLeu8sAeBSItS87ValImdGLCxFmdEXr1LjguJyNuG+Ut+mplmvuJEh2OEfhBOuG 5leyEdhh0U2TfBRi4OAozr3k0yp614Le2exsE9yZwfF3rx92Ufjw2YEYwWBA7M8e0Y6A uiqLc26YOM+4OJ6T29/h5Qg56PIz8jfPM6Wf9R60bT9k6TyNFDyMjrtb2Q5cqfX51OUt jxuZw9rl9k0W8I5L2BG4IvPqyV7xl6IgYTAQ6wlq2xO4bgiTON7twRTnIkFZBKIQKW5N dNigZ8aHAh2SN5rcug8Hy71o0rAASGXNhGx7OI1bwNiQSR8UQJI1T8pZDyGKooIuMvcC CaDw== 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:to:from:date:dkim-signature; bh=AhMRsM2VcgpSkSI9jOKkzyifus7vnIVEMwNmVQF0qwE=; b=mUvHQmUht3/3Qd8G3zAyYq8wcazj6rVmlVmz8It8jHgXvBPYoKsCJm+YfaFJDD2LIv d28BZsDcR63AbNuFYQ++JQI7bG3+MMV+TUhHjs4DHnFkTVqQqK2m0q30XjO1aMTea9UR 5pD0xXkaE0lA2JHHRlNA6mk2JhfaBqYIdsr+r8VM4zMczGzdOXuvLTvf4a8t6qJ84GiA NA3pnl2d240ZLuK4BEPAFVsGBZBGAjZbk6hY6echr0QAC1CTlSde055lEau4DOXZ3Hut l5Q+03Yor+5WpFpa1//ClfMEPrwTxQJAk3VxVlhZZPyVmrI55AR6MIX2GOOq9db6iRQN GhNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=dPP9A7lh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l9-20020a170906794900b0079ddb52369bsi2033345ejo.61.2022.11.19.13.11.33; Sat, 19 Nov 2022 13:11:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=dPP9A7lh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235031AbiKSUxl (ORCPT + 91 others); Sat, 19 Nov 2022 15:53:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234895AbiKSUxi (ORCPT ); Sat, 19 Nov 2022 15:53:38 -0500 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 322E126D9; Sat, 19 Nov 2022 12:53:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1668891195; bh=fw52bMqQOJVIoYoF40uODbxsnJEZGdDI7hukBF588KA=; h=X-EA-Auth:Date:From:To:Subject:Message-ID:MIME-Version: Content-Type; b=dPP9A7lh5/eSskwwh1iUAlYfE8bGp1mZXfKnZnc5Y1LbSENAM+qcZH27W/uvElmdS Zxec1UAca0RwVNLEVfRr7cC0qH7fDDymgVROFf8IqooQdquN7Nbqi0D6jV6ehffoC7 Ce+Y15v8pk+Dc40Z35PK8JAywLB/IjLuHYvXy3hQ= Received: by b-3.in.mailobj.net [192.168.90.13] with ESMTP via ip-206.mailobj.net [213.182.55.206] Sat, 19 Nov 2022 21:53:15 +0100 (CET) X-EA-Auth: tzzRw3US9AUZnWPyLPpSKljBHOIlqB32lRdAQyZ6nFr5okiIoPGw/HnP9758E9uP3AasUQH9DK7Vq/WNRH+RH3PNRUU3uSGk Date: Sun, 20 Nov 2022 02:23:10 +0530 From: Deepak R Varma To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH] Bluetooth: hci_conn: Use kzalloc for kmalloc+memset Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use of kzalloc preferred over combination of kmalloc & memset. Issue identified using coccicheck. Signed-off-by: Deepak R Varma --- Notes: No changes. Just a gentle reminder for review and feedback. net/bluetooth/hci_conn.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 7a59c4487050..287d313aa312 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -824,11 +824,10 @@ static int hci_le_terminate_big(struct hci_dev *hdev, u8 big, u8 bis) bt_dev_dbg(hdev, "big 0x%2.2x bis 0x%2.2x", big, bis); - d = kmalloc(sizeof(*d), GFP_KERNEL); + d = kzalloc(sizeof(*d), GFP_KERNEL); if (!d) return -ENOMEM; - memset(d, 0, sizeof(*d)); d->big = big; d->bis = bis; @@ -861,11 +860,10 @@ static int hci_le_big_terminate(struct hci_dev *hdev, u8 big, u16 sync_handle) bt_dev_dbg(hdev, "big 0x%2.2x sync_handle 0x%4.4x", big, sync_handle); - d = kmalloc(sizeof(*d), GFP_KERNEL); + d = kzalloc(sizeof(*d), GFP_KERNEL); if (!d) return -ENOMEM; - memset(d, 0, sizeof(*d)); d->big = big; d->sync_handle = sync_handle; -- 2.34.1