Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1292457pxb; Thu, 28 Oct 2021 00:36:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWIZN1NCYsaY5zYWXc5IZOpaREzvKXSn1mXoT34oEXjLLO8IXHIXYOqNb6a5j3S5jKf9SG X-Received: by 2002:a17:906:4c58:: with SMTP id d24mr3322102ejw.510.1635406607219; Thu, 28 Oct 2021 00:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635406607; cv=none; d=google.com; s=arc-20160816; b=HYhZUwDLEGr3+96uZJd25kyMIQwU4lnB2lGh2aC6atpedZ4tKYaTDLAoGHw5bRzt89 ZF1H5ftsmlV6lHjROChvHyRIaNuDizs4EE6nAQiFAk9Ixm2z6zvWxaTtJXKZ++5CgCmm yVP8s38yrJWQ2dm23+s8jkVxu/F4s4aaNMz/t5EHEr/mRa/hTpx+dECOWCUdgplxk/+v A0KXHbM5+RTQstBuX6tzQwEQL1SZTmSrqcnbB+mt5XYhBh0WOPilp4OSPwbUoMUYlC3F rvxMXQ8iR0rLvvtz+Qt5C/hZ+IUnhuczWmQP7sB8vFERwFD7KQLV1cw4VboIHFt8Ac+k cscQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=tAsS4XDto9sTBJsiNUMKvu7NHRyi2tTrhGT9WAGnoXI=; b=ECdlKx1EsiTjuznVgML5Eqd9HPBMhnmUXFRgwjY4UY9DkMPX751dWEodNdYGX0rYDw ggF9pVbJ0O1tNoXvc5kb1TX2TI/ji+9ek+RUmFjdg/Mu1TgFnx1tyz6PC78J0veOQ9mG QcwMwTscBaKzfktI3brkUh1ojWKir/ZQSwXQewdP69OO+6fdTJJBOSXX0bZWhQ+5xyCe TSZpmJ94Jq5iSVHjn6qRM+pKlW5sPa6KfmULDzzxJ7DsXjBJ8RkAlPw1r96hEuhXAd7/ VZTMRlLi8XPlBlOwupEMRL3DfjF8vOvirlS/TqTkxfRh/d6XBNxzFGYZoMdCRliWOM/Q lPLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@narfation.org header.s=20121 header.b=f1yKK8hL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=narfation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qw31si1754050ejc.118.2021.10.28.00.36.23; Thu, 28 Oct 2021 00:36:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@narfation.org header.s=20121 header.b=f1yKK8hL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=narfation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229989AbhJ1HhE (ORCPT + 99 others); Thu, 28 Oct 2021 03:37:04 -0400 Received: from dvalin.narfation.org ([213.160.73.56]:44438 "EHLO dvalin.narfation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229971AbhJ1HhD (ORCPT ); Thu, 28 Oct 2021 03:37:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1635406465; 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=tAsS4XDto9sTBJsiNUMKvu7NHRyi2tTrhGT9WAGnoXI=; b=f1yKK8hLKlO/Vg9zhxJFoAztctGpYDNpQQtiHBZpfwAZd4ffdB/7VP+zhNwn8m6BxqNdxw qMwpZHEE1stWgOaINGHl8OaUkP2Xv7HGNvhdOpnVeC84KMvaRtC0IFC17me8ELCKJJ5mZM 2EoIwb6TVai9aY8c7lZjdu7d1R8CmIA= From: Sven Eckelmann To: mareklindner@neomailbox.ch, sw@simonwunderlich.de, a@unstable.cc, Yajun Deng Cc: b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yajun Deng Subject: Re: [PATCH net-next] batman-adv: Fix the wrong definition Date: Thu, 28 Oct 2021 09:34:22 +0200 Message-ID: <3533360.G9yuKbSBSH@ripper> In-Reply-To: <20211028072306.1351-1-yajun.deng@linux.dev> References: <20211028072306.1351-1-yajun.deng@linux.dev> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart10544534.tba8fyArm4"; micalg="pgp-sha512"; protocol="application/pgp-signature" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nextPart10544534.tba8fyArm4 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Sven Eckelmann To: mareklindner@neomailbox.ch, sw@simonwunderlich.de, a@unstable.cc, Yajun Deng Cc: b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yajun Deng Subject: Re: [PATCH net-next] batman-adv: Fix the wrong definition Date: Thu, 28 Oct 2021 09:34:22 +0200 Message-ID: <3533360.G9yuKbSBSH@ripper> In-Reply-To: <20211028072306.1351-1-yajun.deng@linux.dev> References: <20211028072306.1351-1-yajun.deng@linux.dev> On Thursday, 28 October 2021 09:23:06 CEST Yajun Deng wrote: > There are three variables that are required at most, > no need to define four variables. NAck. This is absolutely wrong - the last one is the "STOP" info. With your patch, it would sometimes (action != BATADV_UEV_DEL) not have the stop NULL. See also the second parameter in this for loop on line https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/kobject_uevent.c?id=1fc596a56b334f4d593a2b49e5ff55af6aaa0816#n548 We can discuss that this can be written in a better way. See https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/1403982781.9064.33.camel@joe-AO725/ (also the remark from Antonio). > > Fixes: 0fa4c30d710d ("batman-adv: Make sysfs support optional") Even this Fixes would be wrong. The code is there since commit c6bda689c2c9 ("batman-adv: add wrapper function to throw uevent in userspace"). But even then, this would not fix anything but just be a cleanup. > Signed-off-by: Yajun Deng > --- > net/batman-adv/main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c > index 3ddd66e4c29e..758035b3796d 100644 > --- a/net/batman-adv/main.c > +++ b/net/batman-adv/main.c > @@ -656,7 +656,7 @@ int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type, > { > int ret = -ENOMEM; > struct kobject *bat_kobj; > - char *uevent_env[4] = { NULL, NULL, NULL, NULL }; > + char *uevent_env[3] = {}; > > bat_kobj = &bat_priv->soft_iface->dev.kobj; > > --nextPart10544534.tba8fyArm4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF10rh2Elc9zjMuACXYcKB8Eme0YFAmF6Un4ACgkQXYcKB8Em e0ahbw//RXWo4gRnRdcHgfuizcVUg3BOZqncBdPYsv/yI9Hp0MltHcbTTNAfHKxE PCc0FYbAZbSVhlgdlmDAGcsCVZIemGJXYMIJASgjynxYgPUTPyFqJp2Bv9uoUypy 32w1GgVomhs6c9PtP0IIa2c64MfdC8NAare2m8pUrfL2ejXIIADGo8VmM7uRZb9V SARnQXdJhSa70x6VUALXGeU9L1bcL8eJ3fNrsZfkqnfQrOQ01bxFdw3uyLyY8rdp kDd61bHs1aVhRNPehSg8sTn2+XadKwDSMXk0IKLwrNMuEizYZNW6Gn7cBkvrVqVa +f4MsRzJEhTvztfaA9ipb9XQA+G6uP3n3czY4ZKI5UT9T3D3SN5UXrbu59lruHIV P+ddqxIytNo+w3dhRDIKo1neyyHiWUP3vyGWS9GyjuEOBqr10VPwyTrHUrZ9kz+Z qxsu1rT79oISAp3yf3Zdc+C8cZbkzVcET1esfdxYtP3GbOfxm4Rc69LydiTmiQ5u Vis6ugd49RuWMJgDPemMUfqdZLZFkjB0dOQFNGfr9NOyXcnVs+6Uqjg0KgzS49PJ yotiY9cCEgFv3HBNx5KHvsCpuUVWPvWSvuGS+qt6nZNRj/eBqn0SMCLnRSy2Jvkj tsX0OedkS9RKbklgbnU8NQNL3jZTrmPK5KJWumSou+XEhupJwgA= =UCNt -----END PGP SIGNATURE----- --nextPart10544534.tba8fyArm4--