MacAddressB is an array (unsigned char MacAddressB[ETH_ALEN]) and is allocated as a part of *node_dst (which is a struct hsr_node). So the condition is always false. Detected by Dan Carpenter.
Unified · Split
| @@ -290,10 +290,6 @@ void hsr_addr_subst_dest(struct hsr_node *node_src, struct sk_buff *skb, · 289 unmodified lines | ||
| 290 | 290 | } |
| 291 | 291 | if (port->type != node_dst->AddrB_port) |
| 292 | 292 | return; |
| 293 | − if (!node_dst->MacAddressB) { | |
| 294 | − WARN_ONCE(1, "%s: No MacAddressB\n", __func__); | |
| 295 | − return; | |
| 296 | − } | |
| 297 | 293 | |
| 298 | 294 | ether_addr_copy(eth_hdr(skb)->h_dest, node_dst->MacAddressB); |
| 299 | 295 | } |