On 4/9/24 16:45, [email protected] wrote:
> From: Lin Huang <[email protected]>
> 
> Coverity reports a false positive below:
> Ofproto_class_find__() may return NULL, and dereference it to cause segfault.
> 
> This patch is made just to avoid false-positive Coverity report.
> 
> Tested-by: Zhang YuHuang <[email protected]>
> Signed-off-by: Lin Huang <[email protected]>
> ---
>  ofproto/ofproto.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
> index 122a06f30..21c6a1d82 100644
> --- a/ofproto/ofproto.c
> +++ b/ofproto/ofproto.c
> @@ -800,7 +800,7 @@ ofproto_type_set_config(const char *datapath_type, const 
> struct smap *cfg)
>      datapath_type = ofproto_normalize_type(datapath_type);
>      class = ofproto_class_find__(datapath_type);
>  
> -    if (class->type_set_config) {
> +    if (class && class->type_set_config) {
>          class->type_set_config(datapath_type, cfg);
>      }
>  }


Thanks for the update!  Applied.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to