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>
struct sso_lf_alloc_rsp *rsp_hwgrp;
int rc;
- if (roc_sso->max_hwgrp < nb_hwgrp)
+ if (!nb_hwgrp || roc_sso->max_hwgrp < nb_hwgrp)
return -ENOENT;
- if (roc_sso->max_hws < nb_hws)
+ if (!nb_hws || roc_sso->max_hws < nb_hws)
return -ENOENT;
plt_spinlock_lock(&sso->mbox_lock);