diff --git a/drivers/acpi/pfr_update.c b/drivers/acpi/pfr_update.c
index 149b5b2530b900cd9e07d4b8989ac1451699f3e5..6bb0b778b5da527025772478e0f6d3113bac2607 100644
--- a/drivers/acpi/pfr_update.c
+++ b/drivers/acpi/pfr_update.c
@@ -460,8 +460,8 @@ static ssize_t pfru_write(struct file *file, const char __user *buf,
 	/* map the communication buffer */
 	phy_addr = (phys_addr_t)((buf_info.addr_hi << 32) | buf_info.addr_lo);
 	buf_ptr = memremap(phy_addr, buf_info.buf_size, MEMREMAP_WB);
-	if (IS_ERR(buf_ptr))
-		return PTR_ERR(buf_ptr);
+	if (!buf_ptr)
+		return -ENOMEM;
 
 	if (!copy_from_iter_full(buf_ptr, len, &iter)) {
 		ret = -EINVAL;