c
< 	ptent = pte_mkuffd_wp(ptent);
---
> 	if (pte_valid(ptent)) {
> 		ptent = pte_mkuffd_wp(ptent);
> 	} else {
> 		// Handle the case where ptent is not valid
> 	}
