From f4d2662dff3a13ace24fb8ae328b734bdaf4ac1f Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Fri, 22 Apr 2022 23:25:15 -0700 Subject: [PATCH] Fix find_reg_block handling of NULL register blocks Signed-off-by: Alex Forencich --- lib/mqnic/reg_block.c | 2 +- modules/mqnic/mqnic_reg_block.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mqnic/reg_block.c b/lib/mqnic/reg_block.c index 9db667432..8279c5987 100644 --- a/lib/mqnic/reg_block.c +++ b/lib/mqnic/reg_block.c @@ -105,7 +105,7 @@ struct reg_block *find_reg_block(struct reg_block *list, uint32_t type, uint32_t { struct reg_block *rb = list; - while (rb->type && rb->version && rb->regs) + while (rb->regs) { if (rb->type == type && (!version || rb->version == version)) { diff --git a/modules/mqnic/mqnic_reg_block.c b/modules/mqnic/mqnic_reg_block.c index 83204499a..e417f85a0 100644 --- a/modules/mqnic/mqnic_reg_block.c +++ b/modules/mqnic/mqnic_reg_block.c @@ -101,7 +101,7 @@ struct reg_block *find_reg_block(struct reg_block *list, u32 type, u32 version, { struct reg_block *rb = list; - while (rb->type && rb->version && rb->regs) { + while (rb->regs) { if (rb->type == type && (!version || rb->version == version)) { if (index > 0) index--;