common/cnxk: add lower bound check for SSO resources
authorHanumanth Pothula <hpothula@marvell.com>
Tue, 31 May 2022 12:19:50 +0000 (17:49 +0530)
committerJerin Jacob <jerinj@marvell.com>
Fri, 10 Jun 2022 09:24:29 +0000 (11:24 +0200)
commit61da0fe6c46ab11aeeeb8a9bd939b98ef50eca15
tree5b2ea1af66e646ea31cd91bb112492d416452fa7
parent7767b849ab028db51474dcbd2a51bff3b5f4f81d
common/cnxk: add lower bound check for SSO resources

Observing a crash when the user runs the second test case, with the
first test case using all HWGRP and HWS, SSO resources. This happens
as there are no HWGRP and HWS resources left for the second test case.

Make sure to process a test case only when valid HWGRPS and HWS
are present by adding lower bound check for HWGRPS and HWS.

Signed-off-by: Hanumanth Pothula <hpothula@marvell.com>
drivers/common/cnxk/roc_sso.c