Re: [PATCH][linux-next] net/mlx5: Bridge, fix uninitialized variable in mlx5_esw_bridge_port_changeupper()

From: Vlad Buslov
Date: Wed Aug 18 2021 - 12:48:09 EST


On Wed 18 Aug 2021 at 18:52, Tim Gardner <tim.gardner@xxxxxxxxxxxxx> wrote:
> A recent change removed code that initialized the return code variable 'err'. It
> is now possible for mlx5_esw_bridge_port_changeupper() to return an error code
> using this uninitialized variable. Fix it by initializing to 0.
>
> Addresses-Coverity: ("Uninitialized scalar variable (UNINIT)")
>
> Cc: Saeed Mahameed <saeedm@xxxxxxxxxx>
> Cc: Leon Romanovsky <leon@xxxxxxxxxx>
> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
> Cc: Jakub Kicinski <kuba@xxxxxxxxxx>
> Cc: Vlad Buslov <vladbu@xxxxxxxxxx>
> Cc: Jianbo Liu <jianbol@xxxxxxxxxx>
> Cc: Mark Bloch <mbloch@xxxxxxxxxx>
> Cc: Roi Dayan <roid@xxxxxxxxxx>
> Cc: Vladimir Oltean <vladimir.oltean@xxxxxxx>
> Cc: netdev@xxxxxxxxxxxxxxx
> Cc: linux-rdma@xxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Signed-off-by: Tim Gardner <tim.gardner@xxxxxxxxxxxxx>
> ---

Tim, thanks for fixing this!

Saeed, this is the second similar issue that I mentioned in my reply to
Colin. Again, I've already submitted same patch internally and this one
is as good as mine.

Reviewed-by: Vlad Buslov <vladbu@xxxxxxxxxx>

[...]