diff options
Diffstat (limited to 'kernel/drivers/misc/cxl')
-rw-r--r-- | kernel/drivers/misc/cxl/context.c | 4 | ||||
-rw-r--r-- | kernel/drivers/misc/cxl/main.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/kernel/drivers/misc/cxl/context.c b/kernel/drivers/misc/cxl/context.c index d1b55fe62..e4dc8cdf6 100644 --- a/kernel/drivers/misc/cxl/context.c +++ b/kernel/drivers/misc/cxl/context.c @@ -113,11 +113,11 @@ static int cxl_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) if (ctx->afu->current_mode == CXL_MODE_DEDICATED) { area = ctx->afu->psn_phys; - if (offset > ctx->afu->adapter->ps_size) + if (offset >= ctx->afu->adapter->ps_size) return VM_FAULT_SIGBUS; } else { area = ctx->psn_phys; - if (offset > ctx->psn_size) + if (offset >= ctx->psn_size) return VM_FAULT_SIGBUS; } diff --git a/kernel/drivers/misc/cxl/main.c b/kernel/drivers/misc/cxl/main.c index 8ccddceea..de350dd46 100644 --- a/kernel/drivers/misc/cxl/main.c +++ b/kernel/drivers/misc/cxl/main.c @@ -73,7 +73,7 @@ static inline void cxl_slbia_core(struct mm_struct *mm) spin_lock(&adapter->afu_list_lock); for (slice = 0; slice < adapter->slices; slice++) { afu = adapter->afu[slice]; - if (!afu->enabled) + if (!afu || !afu->enabled) continue; rcu_read_lock(); idr_for_each_entry(&afu->contexts_idr, ctx, id) |