Add input arg verification.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
drivers/common/cnxk/hw/cpt.h | 2 ++
drivers/common/cnxk/roc_cpt.c | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
@@ -64,6 +64,7 @@ union cpt_lf_ctx_flush {
struct {
uint64_t cptr : 46;
uint64_t inval : 1;
+ uint64_t reserved_47_63 : 17;
} s;
};
@@ -71,6 +72,7 @@ union cpt_lf_ctx_reload {
uint64_t u;
struct {
uint64_t cptr : 46;
+ uint64_t reserved_46_63 : 18;
} s;
};
@@ -681,8 +681,10 @@ roc_cpt_lf_ctx_flush(struct roc_cpt_lf *lf, void *cptr, bool inval)
{
union cpt_lf_ctx_flush reg;
- if (lf == NULL)
+ if (lf == NULL) {
+ plt_err("Could not trigger CTX flush");
return -ENOTSUP;
+ }
reg.u = 0;
reg.s.inval = inval;