Skip to content

Commit

Permalink
net: microchip: sparx5: Fix uninitialized variable in vcap_path_exist()
Browse files Browse the repository at this point in the history
The "eport" variable needs to be initialized to NULL for this code to
work.

Fixes: 814e769 ("net: microchip: vcap api: Add a storage state to a VCAP rule")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Link: https://lore.kernel.org/r/Y8qbYAb+YSXo1DgR@kili
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Dan Carpenter authored and Jakub Kicinski committed Jan 24, 2023
1 parent 8a8b70b commit 3bee9b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/microchip/vcap/vcap_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2010,7 +2010,8 @@ static int vcap_get_next_chain(struct vcap_control *vctrl,
static bool vcap_path_exist(struct vcap_control *vctrl, struct net_device *ndev,
int dst_cid)
{
struct vcap_enabled_port *eport, *elem;
struct vcap_enabled_port *eport = NULL;
struct vcap_enabled_port *elem;
struct vcap_admin *admin;
int tmp;

Expand Down

0 comments on commit 3bee9b5

Please sign in to comment.