summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/microchip/vcap
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2023-01-20 16:47:12 +0300
committerJakub Kicinski <kuba@kernel.org>2023-01-24 08:34:59 +0300
commit3bee9b573af515a8f15db70e7875ac96f87d57b5 (patch)
tree587d139f9a45b4a433d212e966c6655f29b50684 /drivers/net/ethernet/microchip/vcap
parent8a8b70b3f2cf1155b164ddf649b3c033085451e4 (diff)
downloadlinux-3bee9b573af515a8f15db70e7875ac96f87d57b5.tar.xz
net: microchip: sparx5: Fix uninitialized variable in vcap_path_exist()
The "eport" variable needs to be initialized to NULL for this code to work. Fixes: 814e7693207f ("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>
Diffstat (limited to 'drivers/net/ethernet/microchip/vcap')
-rw-r--r--drivers/net/ethernet/microchip/vcap/vcap_api.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api.c b/drivers/net/ethernet/microchip/vcap/vcap_api.c
index d9cf2cd1925a..2eaa857d8c1a 100644
--- a/drivers/net/ethernet/microchip/vcap/vcap_api.c
+++ b/drivers/net/ethernet/microchip/vcap/vcap_api.c
@@ -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;