c
< 	upper = kmemdup(&entry[max + 1],
---
> 	size_t entry_size = sizeof(entry) / sizeof(entry[0]);
> 	if (max >= entry_size) {
> 		// Handle error: max is out of bounds
> 	} else {
> 		upper = kmemdup(&entry[max + 1],
> 	}
