Message ID | 20240523191152.589605-2-mkp@redhat.com |
---|---|
State | Changes Requested, archived |
Headers | show |
Series | [ovs-dev,v2,1/6] netdev-offload: Fix null pointer dereference' warnings on dump creation. | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | success | apply and check: success |
ovsrobot/github-robot-_Build_and_Test | success | github build: passed |
ovsrobot/intel-ovs-compilation | success | test: success |
On 5/23/24 21:11, Mike Pattrick wrote: > Clang's static analyzer will complain about uninitialized value 'hlen' > because we weren't properly checking the error code from a function that > would have initialized the value. > > Instead, add a check for that return code. > > Signed-off-by: Mike Pattrick <mkp@redhat.com> > Fixes: 03fc1ad78521 ("userspace: Add SRv6 tunnel support.") Nit: The 'Fixes' tag should go before the SoB. Also, please, either send patches separately, or add a cover letter to the set. Best regards, Ilya Maximets. > --- > lib/netdev-native-tnl.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c > index dee9ab344..6bcc00d8c 100644 > --- a/lib/netdev-native-tnl.c > +++ b/lib/netdev-native-tnl.c > @@ -1068,7 +1068,10 @@ netdev_srv6_pop_header(struct dp_packet *packet) > } > > pkt_metadata_init_tnl(md); > - netdev_tnl_ip_extract_tnl_md(packet, tnl, &hlen); > + if (!netdev_tnl_ip_extract_tnl_md(packet, tnl, &hlen)) { > + goto err; > + } > + > dp_packet_reset_packet(packet, hlen); > > return packet;
diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c index dee9ab344..6bcc00d8c 100644 --- a/lib/netdev-native-tnl.c +++ b/lib/netdev-native-tnl.c @@ -1068,7 +1068,10 @@ netdev_srv6_pop_header(struct dp_packet *packet) } pkt_metadata_init_tnl(md); - netdev_tnl_ip_extract_tnl_md(packet, tnl, &hlen); + if (!netdev_tnl_ip_extract_tnl_md(packet, tnl, &hlen)) { + goto err; + } + dp_packet_reset_packet(packet, hlen); return packet;
Clang's static analyzer will complain about uninitialized value 'hlen' because we weren't properly checking the error code from a function that would have initialized the value. Instead, add a check for that return code. Signed-off-by: Mike Pattrick <mkp@redhat.com> Fixes: 03fc1ad78521 ("userspace: Add SRv6 tunnel support.") --- lib/netdev-native-tnl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)