[PATCH 05/25] common/cnxk: verify input args
Anoob Joseph
anoobj at marvell.com
Tue Dec 7 07:50:38 CET 2021
Add input arg verification.
Signed-off-by: Anoob Joseph <anoobj at marvell.com>
---
drivers/common/cnxk/hw/cpt.h | 2 ++
drivers/common/cnxk/roc_cpt.c | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/common/cnxk/hw/cpt.h b/drivers/common/cnxk/hw/cpt.h
index 919f842..ccc7af4 100644
--- a/drivers/common/cnxk/hw/cpt.h
+++ b/drivers/common/cnxk/hw/cpt.h
@@ -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;
};
diff --git a/drivers/common/cnxk/roc_cpt.c b/drivers/common/cnxk/roc_cpt.c
index 8f8e6d3..1bc7a29 100644
--- a/drivers/common/cnxk/roc_cpt.c
+++ b/drivers/common/cnxk/roc_cpt.c
@@ -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;
--
2.7.4
More information about the dev
mailing list