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

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