Received: by 10.223.164.202 with SMTP id h10csp1216563wrb; Wed, 15 Nov 2017 15:27:51 -0800 (PST) X-Google-Smtp-Source: AGs4zMYlT1kaXyoLBRd+UEqjj93ty0gfeNWkiy6IJUwuCvj8I1JPOF4sf40z61fgFRvztvoHxE0e X-Received: by 10.98.97.1 with SMTP id v1mr19478920pfb.105.1510788471834; Wed, 15 Nov 2017 15:27:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510788471; cv=none; d=google.com; s=arc-20160816; b=BkbJjr75r6OdNEGYcZeGljToBSK4SuilggB367YQ3Ah7zY/aDwBTo8XxIXmnel2hgc KgKgbOqKvlFE4RMymeGFlGnJ3qI5LRufYnI0IbL9jvO8a82FeCubq2v1NhB+cNDzrmMr BMNEWRZjilW1p9w7tzlOneyipr6Sm3YEWmgXq584w77hvN+JuDXvkaRFk/cVWFe/0wEv gth82xCi+ZBn5HiPBJ3wuIn7OgnrSiRT5ExjVVRJJ2Li9J+7Y0orPLYGFwgjo7E17iff dfEJ8CMJ1Kpov0ObHIO+9byd+2dqqK1/oCZTjke4KMuRyoAl+IbqLT+oclrqqGqouVOq YYag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Mh21Vqdx8NLKA/XNsiIv5TrTvyaNWlRPFjXwNUUe57c=; b=dDLDQn85d8LsGCNVStV65CBcYzT9zzg3xrY81ScCWYJOh2Lars4w4Rk09CIqjeFev9 29ljHTI0n2i18tKGOO8ttuvOevU2Uc4CsQ9rEazf1FUjAyUNHUwJP8WSZ6Fj/ypWOJH1 C9KyBWWsSTD5/De+cI94Lz6n4dCrRoPyQ8c2US7oiFgUzkYkerIIZ8zuGopV7Eq0u0vn Brwwnx6Y99Juxhfq2SjyMB425mAUuCamJjdPkuErr9lMZmMg5PZUf9OQ0HT7FoVbRaik aMuO+2PYOtvxGekNj2yj5MrlK3mpkKWkTzbDOxvoN7jb3wZxkbBktNQ/lE9wp16gocQK kiug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=twzxkZoA; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h90si18719767plb.253.2017.11.15.15.27.39; Wed, 15 Nov 2017 15:27:51 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=twzxkZoA; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759321AbdKOT6g (ORCPT + 89 others); Wed, 15 Nov 2017 14:58:36 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:56321 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755702AbdKOT62 (ORCPT ); Wed, 15 Nov 2017 14:58:28 -0500 Received: by mail-lf0-f66.google.com with SMTP id g35so13308340lfi.13; Wed, 15 Nov 2017 11:58:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Mh21Vqdx8NLKA/XNsiIv5TrTvyaNWlRPFjXwNUUe57c=; b=twzxkZoAK6yRTwVWjDF/RYccCwKkzK13LcH5cnYF6SfWToTGTkdwX6CRyD4+7Hbsg6 c2j6FbnLS5ZOL+pWXiUvKeX8gR7CCRTGedeTQd/hKqyWS5iHS6u2MWVnRCWzgNQZAciC ediNGOFrt603q44w0gkukcAfHroT0AFkXCVST9YFfhDLhE13fFts5211bg64N8Ozik+/ L+9KlKgpwgCoMgMXu5MLSDft3PfwtyGZBh1OVx+4jQCPHMQ4uYzi3xHmi9R3EY7iXCoW zoAOsTckM6nmhYq9zWfDM84LMMOys+ZX/MvCfsRi6Ia57HeXcVyr/+Ebiq98VNSN0ypJ yIuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Mh21Vqdx8NLKA/XNsiIv5TrTvyaNWlRPFjXwNUUe57c=; b=VHI0Xz3q+S1WDcN+HfeZEflDBFNNMrUoltTC30RqYUOiwq5YVWH7tW4NXVXUTeeK1I 5iS7vHEKicE8TGI/AdyuoAvY/mOls6kdTIe6VLSjNGdzaixfrB01QtpG2i428zS/v3os OzURCB1ytb8nQ4ns/Voqitp2BPvf0UL01S/WKz6VmS5+k6JtLMTZ1yoXAxPdIz3D0SYG 5nr8YKuzb8vHtEMRlgiQA6VhrbcFGcz5Wr02VI3djByeYNrlvnC8vZ6OYDICroMoDJJ7 RBFenYOUqakpnLfTkEk/Y5TlyOmBKLWuPbqJuK2RwcPZCle8tu8Ua0WjG3bQGByeDjzl a/Gg== X-Gm-Message-State: AJaThX7A8M8z8uQ43GMij1mMGHuh3u8foiiQn1yLHDjj+Mq3rsEgaJnN VoOueTCs1fZ2pkeRmzbEX0E= X-Received: by 10.46.83.67 with SMTP id t3mr6528104ljd.135.1510775906571; Wed, 15 Nov 2017 11:58:26 -0800 (PST) Received: from localhost.localdomain ([195.254.138.66]) by smtp.gmail.com with ESMTPSA id 17sm2229694ljh.73.2017.11.15.11.58.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Nov 2017 11:58:25 -0800 (PST) From: Vasyl Gomonovych To: gomonovych@gmail.com, Ariel.Elior@cavium.com, everest-linux-l2@cavium.com, netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] qed: fix unnecessary call to memset cocci warnings Date: Wed, 15 Nov 2017 20:58:15 +0100 Message-Id: <1510775895-16258-1-git-send-email-gomonovych@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use kzalloc rather than kmalloc followed by memset with 0 drivers/net/ethernet/qlogic/qed/qed_dcbx.c:1280:13-20: WARNING: kzalloc should be used for dcbx_info, instead of kmalloc/memset Generated by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci Originally was fixed in: 'commit 561ed23331df ("qed: fix kzalloc-simple.cocci warnings")' But later warning was introduced in: 'commit 62289ba27558 ("qed: Fix possible system hang in the dcbnl-getdcbx() path.")' Signed-off-by: Vasyl Gomonovych --- drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c index 8f6ccc0c39e5..9a1bd996a640 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c @@ -1277,11 +1277,10 @@ static struct qed_dcbx_get *qed_dcbnl_get_dcbx(struct qed_hwfn *hwfn, { struct qed_dcbx_get *dcbx_info; - dcbx_info = kmalloc(sizeof(*dcbx_info), GFP_ATOMIC); + dcbx_info = kzmalloc(sizeof(*dcbx_info), GFP_ATOMIC); if (!dcbx_info) return NULL; - memset(dcbx_info, 0, sizeof(*dcbx_info)); if (qed_dcbx_query_params(hwfn, dcbx_info, type)) { kfree(dcbx_info); return NULL; -- 1.9.1 From 1584658864119037179@xxx Tue Nov 21 07:14:18 +0000 2017 X-GM-THRID: 1584643437638574134 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread