Skip to content

Commit

Permalink
octeontx2-af: Fix possible null pointer dereference.
Browse files Browse the repository at this point in the history
This patch fixes possible null pointer dereference in files
"rvu_debugfs.c" and "rvu_nix.c"

Fixes: 8756828 ("octeontx2-af: Add NPA aura and pool contexts to debugfs")
Fixes: 9a946de ("octeontx2-af: Modify nix_vtag_cfg mailbox to support TX VTAG entries")
Signed-off-by: Rakesh Babu Saladi <rsaladi2@marvell.com>
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Rakesh Babu Saladi authored and David S. Miller committed Oct 28, 2021
1 parent e77bcdd commit c2d4c54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ static ssize_t rvu_dbg_qsize_write(struct file *filp,
if (cmd_buf)
ret = -EINVAL;

if (!strncmp(subtoken, "help", 4) || ret < 0) {
if (ret < 0 || !strncmp(subtoken, "help", 4)) {
dev_info(rvu->dev, "Use echo <%s-lf > qsize\n", blk_string);
goto qsize_write_done;
}
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
Original file line number Diff line number Diff line change
Expand Up @@ -2507,6 +2507,9 @@ static void nix_free_tx_vtag_entries(struct rvu *rvu, u16 pcifunc)
return;

nix_hw = get_nix_hw(rvu->hw, blkaddr);
if (!nix_hw)
return;

vlan = &nix_hw->txvlan;

mutex_lock(&vlan->rsrc_lock);
Expand Down

0 comments on commit c2d4c54

Please sign in to comment.