octeontx2-af: Fix missing check bugs in rvu_cgx.c
authorYingjie Wang <wangyingjie55@126.com>
Fri, 15 Jan 2021 14:10:04 +0000 (06:10 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jan 2021 10:55:21 +0000 (11:55 +0100)
commit2fc06bfa701d031e27ba24c6aec24f124fe13650
tree4c70237b08c663b5b930fbfb76f85a943c9f287c
parent19187877057d2f358a13f608d6e61cca4e464d68
octeontx2-af: Fix missing check bugs in rvu_cgx.c

commit b7ba6cfabc42fc846eb96e33f1edcd3ea6290a27 upstream.

In rvu_mbox_handler_cgx_mac_addr_get()
and rvu_mbox_handler_cgx_mac_addr_set(),
the msg is expected only from PFs that are mapped to CGX LMACs.
It should be checked before mapping,
so we add the is_cgx_config_permitted() in the functions.

Fixes: 96be2e0da85e ("octeontx2-af: Support for MAC address filters in CGX")
Signed-off-by: Yingjie Wang <wangyingjie55@126.com>
Reviewed-by: Geetha sowjanya<gakula@marvell.com>
Link: https://lore.kernel.org/r/1610719804-35230-1-git-send-email-wangyingjie55@126.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c