linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: intel_quark_i2c_gpio: fix write to const mem
@ 2021-03-20 19:38 Tong Zhang
  0 siblings, 0 replies; only message in thread
From: Tong Zhang @ 2021-03-20 19:38 UTC (permalink / raw)
  To: Lee Jones, Rikard Falkeborn, linux-kernel; +Cc: Tong Zhang

intel_quark_i2c_res and intel_quark_gpio_res are written by
intel_quark_mfd_probe. Making them const can cause page fault.

[    1.319934] BUG: unable to handle page fault for address: ffffffffc00be140
[    1.320296] #PF: supervisor write access in kernel mode
[    1.320571] #PF: error_code(0x0003) - permissions violation
[    1.322419] RIP: 0010:intel_quark_mfd_probe+0xb7/0x23e [intel_quark_i2c_gpio]
[    1.327670] Call Trace:
[    1.327800]  local_pci_probe+0x48/0x80

Fixes: c4a164f41554 (mfd: Constify static struct resources)
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
---
 drivers/mfd/intel_quark_i2c_gpio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/intel_quark_i2c_gpio.c b/drivers/mfd/intel_quark_i2c_gpio.c
index fe8ca945f367..84ca7902e1df 100644
--- a/drivers/mfd/intel_quark_i2c_gpio.c
+++ b/drivers/mfd/intel_quark_i2c_gpio.c
@@ -72,7 +72,7 @@ static const struct dmi_system_id dmi_platform_info[] = {
 	{}
 };
 
-static const struct resource intel_quark_i2c_res[] = {
+static struct resource intel_quark_i2c_res[] = {
 	[INTEL_QUARK_IORES_MEM] = {
 		.flags = IORESOURCE_MEM,
 	},
@@ -85,7 +85,7 @@ static struct mfd_cell_acpi_match intel_quark_acpi_match_i2c = {
 	.adr = MFD_ACPI_MATCH_I2C,
 };
 
-static const struct resource intel_quark_gpio_res[] = {
+static struct resource intel_quark_gpio_res[] = {
 	[INTEL_QUARK_IORES_MEM] = {
 		.flags = IORESOURCE_MEM,
 	},
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-20 19:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-20 19:38 [PATCH] mfd: intel_quark_i2c_gpio: fix write to const mem Tong Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).