Re: [PATCH] dpaa2-switch: fix default return of dpaa2_switch_flower_parse_mirror_key

From: Ioana Ciornei
Date: Tue Feb 15 2022 - 06:51:25 EST


On Mon, Feb 14, 2022 at 07:41:39AM -0800, trix@xxxxxxxxxx wrote:
> From: Tom Rix <trix@xxxxxxxxxx>
>
> Clang static analysis reports this representative problem
> dpaa2-switch-flower.c:616:24: warning: The right operand of '=='
> is a garbage value
> tmp->cfg.vlan_id == vlan) {
> ^ ~~~~
> vlan is set in dpaa2_switch_flower_parse_mirror_key(). However
> this function can return success without setting vlan. So
> change the default return to -EOPNOTSUPP.
>
> Fixes: 0f3faece5808 ("dpaa2-switch: add VLAN based mirroring")
> Signed-off-by: Tom Rix <trix@xxxxxxxxxx>


Reviewed-by: Ioana Ciornei <ioana.ciornei@xxxxxxx>

Thanks!