public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [bug report] batman-adv: make the TT CRC logic VLAN specific
@ 2016-11-30 19:53 Dan Carpenter
  2016-12-02 16:34 ` Sven Eckelmann
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2016-11-30 19:53 UTC (permalink / raw)
  To: antonio; +Cc: b.a.t.m.a.n

Hello Antonio Quartulli,

The patch 7ea7b4a14275: "batman-adv: make the TT CRC logic VLAN
specific" from Jul 30, 2013, leads to the following static checker
warning:

	net/batman-adv/translation-table.c:3294 batadv_send_my_tt_response()
	error: uninitialized symbol 'tt_change'.

net/batman-adv/translation-table.c
  3282          if (!full_table) {
  3283                  spin_lock_bh(&bat_priv->tt.last_changeset_lock);
  3284  
  3285                  tt_len = bat_priv->tt.last_changeset_len;
  3286                  tvlv_len = batadv_tt_prepare_tvlv_local_data(bat_priv,
  3287                                                               &tvlv_tt_data,
  3288                                                               &tt_change,
  3289                                                               &tt_len);
  3290                  if (!tt_len)
  3291                          goto unlock;

This should probably be changed to:

			if (!tt_len || !tvlv_len)
				goto unlock;

There seems to be an assumption that "tt_len" is set to zero on the
error path?  That's another way to fix this, I suppose.

  3292  
  3293                  /* Copy the last orig_node's OGM buffer */
  3294                  memcpy(tt_change, bat_priv->tt.last_changeset,
  3295                         bat_priv->tt.last_changeset_len);
  3296                  spin_unlock_bh(&bat_priv->tt.last_changeset_lock);
  3297          } else {

See also:

	net/batman-adv/translation-table.c:3313 batadv_send_my_tt_response()
	error: uninitialized symbol 'tt_change'.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [B.A.T.M.A.N.] [bug report] batman-adv: make the TT CRC logic VLAN specific
  2016-11-30 19:53 [B.A.T.M.A.N.] [bug report] batman-adv: make the TT CRC logic VLAN specific Dan Carpenter
@ 2016-12-02 16:34 ` Sven Eckelmann
  2016-12-05 10:06   ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Sven Eckelmann @ 2016-12-02 16:34 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Dan Carpenter

[-- Attachment #1: Type: text/plain, Size: 777 bytes --]

On Mittwoch, 30. November 2016 22:53:27 CET Dan Carpenter wrote:
> Hello Antonio Quartulli,
> 
> The patch 7ea7b4a14275: "batman-adv: make the TT CRC logic VLAN
> specific" from Jul 30, 2013, leads to the following static checker
> warning:
[...]
> 	net/batman-adv/translation-table.c:3313 batadv_send_my_tt_response()
> 	error: uninitialized symbol 'tt_change'.

Thank you very much for your excellent report. Antonio seems to be busy
at the moment but Simon already forwarded [1] your suggestion to David.

Small question - what static checker reported that? I would usually guess
smatch when I see your name but at least it was not reproducible with the
current smatch from http://repo.or.cz/w/smatch.git

Kind regards,
	Sven

[1] https://patchwork.ozlabs.org/patch/702031/

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [B.A.T.M.A.N.] [bug report] batman-adv: make the TT CRC logic VLAN specific
  2016-12-02 16:34 ` Sven Eckelmann
@ 2016-12-05 10:06   ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-12-05 10:06 UTC (permalink / raw)
  To: Sven Eckelmann; +Cc: b.a.t.m.a.n

On Fri, Dec 02, 2016 at 05:34:39PM +0100, Sven Eckelmann wrote:
> On Mittwoch, 30. November 2016 22:53:27 CET Dan Carpenter wrote:
> > Hello Antonio Quartulli,
> > 
> > The patch 7ea7b4a14275: "batman-adv: make the TT CRC logic VLAN
> > specific" from Jul 30, 2013, leads to the following static checker
> > warning:
> [...]
> > 	net/batman-adv/translation-table.c:3313 batadv_send_my_tt_response()
> > 	error: uninitialized symbol 'tt_change'.
> 
> Thank you very much for your excellent report. Antonio seems to be busy
> at the moment but Simon already forwarded [1] your suggestion to David.
> 
> Small question - what static checker reported that? I would usually guess
> smatch when I see your name but at least it was not reproducible with the
> current smatch from http://repo.or.cz/w/smatch.git

It's some unreleased Smatch stuff I'm working on.  (Very buggy).

regards,
dan carpenter



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-05 10:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-30 19:53 [B.A.T.M.A.N.] [bug report] batman-adv: make the TT CRC logic VLAN specific Dan Carpenter
2016-12-02 16:34 ` Sven Eckelmann
2016-12-05 10:06   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox