Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6478198rdb; Tue, 2 Jan 2024 03:28:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjLSlh/OHwtl8QI6Zavs+6k/26qwV9iYXZukgPrrys15YABckiCbKkRJ38yCmYH/Hk4y6l X-Received: by 2002:a05:6214:509b:b0:680:c75f:b444 with SMTP id kk27-20020a056214509b00b00680c75fb444mr188426qvb.37.1704194915604; Tue, 02 Jan 2024 03:28:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704194915; cv=none; d=google.com; s=arc-20160816; b=oP1fsxNPpjseEgwBli9syfs0Pdg+AaQWCO3vEZm4HKE6X78DrhDzCqXQTpt8HxFT1g zkNoXFwgzpo2dqmqVOWlY4IiKxrYcKbOzmQS0yTCSxxxCt4mjFO0APzx3Z7RZG4EcP53 dEHeuEmnBP/0hEfh1W8q20nygIdnK+jri2XgwcAXJcoAuApL1t9Em9cGN8PSOrpN4BXI mPwOCa92sVWvRDRzr3RXdeVG0L9pBUYiv3AH86AdOqE9HwHc1gMZD12EKGoLKO4eIXO8 /aVyzAt6azZvx59P3siTj/J3Gayxe3Rpt18LFQK/+5cM7LSR4ljJp/7qV6WaMw2UiX6z oZVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IKJCpy+cXuzjprgjg+Of6HIRqe2chRqAQCoAEdEUmLc=; fh=jj7v9eOwpc0/U5FSF0S/3fncoqwulC6cJUEmPJX6syQ=; b=W2RDP+0T1GtQ5jOC/u5FLJW1LYV4qp/ebVJ081esxi67uvemtQT25pvxkljTRpXr6X amh29BlaGq8+RbZVM2Yeys5+0Rr98FQGteTyDGduYAy/j6iLKvmzijxwLA5hCG3LMtA9 jWRFakivMKPmc6k2h5d0odhYtoVHKabxn+pGY0oa9MfRKzmCCQmLUN89puiaL6OJfkSg rxE466sbIzYCUKgKqPkiGnxw+NN50/zXO1NdXZreUJ3wlU/675wyKQVFKx4T0aOCjlfq nNd6KziT+qYCSUmRBxspWCZ1Xp8hf+MHolCkngwyT30bfKCmsIdSSJqtrHntTzJA+g/R typQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@narfation.org header.s=20121 header.b=Ma1AcYdF; spf=pass (google.com: domain of linux-kernel+bounces-14288-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14288-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=narfation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m9-20020a0cf189000000b0067f6f3aeff7si27958496qvl.0.2024.01.02.03.28.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 03:28:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14288-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@narfation.org header.s=20121 header.b=Ma1AcYdF; spf=pass (google.com: domain of linux-kernel+bounces-14288-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14288-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=narfation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 582621C21E2C for ; Tue, 2 Jan 2024 11:28:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A63FEACB; Tue, 2 Jan 2024 11:28:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=narfation.org header.i=@narfation.org header.b="Ma1AcYdF" X-Original-To: linux-kernel@vger.kernel.org Received: from dvalin.narfation.org (dvalin.narfation.org [213.160.73.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52B39DF6A; Tue, 2 Jan 2024 11:28:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=narfation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=narfation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1704194540; 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: in-reply-to:in-reply-to:references:references; bh=IKJCpy+cXuzjprgjg+Of6HIRqe2chRqAQCoAEdEUmLc=; b=Ma1AcYdF6RGml4NMC2wYnGW8Vy7bjxkIzK37EUrf2SOtuanqn/FetHnrbA82SaaooQe92G Mhnjmwbsq85AfOHyz7iQ0XHuHmEeytkzWWUp4MladgBss0XUVBDLqt6+JL42CIWfs/dW8/ /64eblXjavruLl8t+a/CvRTjviKw6ao= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, Antonio Quartulli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Marek Lindner , Paolo Abeni , Simon Wunderlich , Markus Elfring Cc: LKML Subject: Re: [PATCH 1/2] batman-adv: Return directly after a failed batadv_dat_select_candidates() in batadv_dat_forward_data() Date: Tue, 02 Jan 2024 12:22:16 +0100 Message-ID: <12355496.O9o76ZdvQC@sven-l14> In-Reply-To: <54dc53f8-5f08-4f1d-938a-c845c8ec0d44@web.de> References: <8588cafe-3c61-40a6-b071-0877632a2a1e@web.de> <54dc53f8-5f08-4f1d-938a-c845c8ec0d44@web.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart5744289.DvuYhMxLoT"; micalg="pgp-sha512"; protocol="application/pgp-signature" --nextPart5744289.DvuYhMxLoT Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Sven Eckelmann Cc: LKML Date: Tue, 02 Jan 2024 12:22:16 +0100 Message-ID: <12355496.O9o76ZdvQC@sven-l14> In-Reply-To: <54dc53f8-5f08-4f1d-938a-c845c8ec0d44@web.de> MIME-Version: 1.0 On Tuesday, 2 January 2024 08:11:47 CET Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 2 Jan 2024 07:27:45 +0100 >=20 > The kfree() function was called in one case by > the batadv_dat_forward_data() function during error handling > even if the passed variable contained a null pointer. > This issue was detected by using the Coccinelle software. >=20 > * Thus return directly after a batadv_dat_select_candidates() call failed > at the beginning. >=20 > * Delete the label =E2=80=9Cout=E2=80=9D which became unnecessary with th= is refactoring. >=20 > Signed-off-by: Markus Elfring Acked-by: Sven Eckelmann > --- > net/batman-adv/distributed-arp-table.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/dist= ributed-arp-table.c > index 28a939d56090..4c7e85534324 100644 > --- a/net/batman-adv/distributed-arp-table.c > +++ b/net/batman-adv/distributed-arp-table.c > @@ -684,7 +684,7 @@ static bool batadv_dat_forward_data(struct batadv_pri= v *bat_priv, >=20 > cand =3D batadv_dat_select_candidates(bat_priv, ip, vid); > if (!cand) > - goto out; > + return ret; >=20 > batadv_dbg(BATADV_DBG_DAT, bat_priv, "DHT_SEND for %pI4\n", &ip); >=20 > @@ -728,7 +728,6 @@ static bool batadv_dat_forward_data(struct batadv_pri= v *bat_priv, > batadv_orig_node_put(cand[i].orig_node); > } >=20 > -out: > kfree(cand); > return ret; > } > -- > 2.43.0 >=20 >=20 --nextPart5744289.DvuYhMxLoT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF10rh2Elc9zjMuACXYcKB8Eme0YFAmWT8ekACgkQXYcKB8Em e0Zezg/+P9PfejkVp+OoIyYjl/JOvoFqwplYaSBqhuTzvIVSx8fGZmzS0eBHploL kIPHLR9UoxD4ghhd0JX1Vu/e2bWMQUFJGmzX92xFcXxMrx/FJ3DfMRM9rPSkd/FX Z4QFQp5BkQuqWk1tICiOSP+GeGtiXY9UZnrYFEKmJG601RaziFMGXC8va/zmaBBD 7+YTYyJwPxO5jF+KLIEMJjCT1b4+o9fneoGdwpoyvk0JyC9FbYbiOPeeB+37PczD X1YGGNnAmF8cPFU89J/8XXplraK8HAOaivzAsTDPnBOu4SP/spQKWefX/LgqkFWx 5c0l02CzZapL6szJEk1ZbqTfXrRbDjnqFxxIV7HBbtnx6hkSbPvNcubB+B1k56AA l+2EY9gPnIUe/a5C11LUYc4zfNF5Z+k8ZgtrRiTiR+CstKtjBdiGytyRN4Lj/7ax YmhnVkAKY/Dr79Frc76jP+sGNnCzHna9AhHUyHBtHRdr6/vx8ggEPtylrxjsVll0 VCZuKAM23pJ8fKdEiexVon9pX5UXq+nqIBc/iZvU0+i/QE8GK/DAd1lWVoDpFDvA 25O42/MbEUefcd4VHksZdNLOqxKwyFJunUZmS5piyt7VO2RhRUQQVCeWDvETpZ+/ oyV9q09FlZRIYbRioLqmv2jNV7WoUSw3DWOrh7GUe1vsWzYhzmM= =QSP4 -----END PGP SIGNATURE----- --nextPart5744289.DvuYhMxLoT--