]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: intel_mid_powerbtn: Take a copy of ddata
authorMika Westerberg <mika.westerberg@linux.intel.com>
Wed, 22 Jan 2020 16:05:20 +0000 (19:05 +0300)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 22 Jan 2020 16:51:58 +0000 (18:51 +0200)
commit91e75e8b322c7086237ef746d6a4686a86f186f1
tree311568407747e1e384e6a873e993b2ff1a80c2c9
parentfce231e39deccd9a545821fcc80f4b4ba4477a45
platform/x86: intel_mid_powerbtn: Take a copy of ddata

The driver gets driver_data from memory that is marked as const (which
is probably put to read-only memory) and it then modifies it. This
likely causes some sort of fault to happen.

Fix this by taking a copy of the structure.

Fixes: 46148ea887bf ("platform/x86: intel_mid_powerbtn: make mid_pb_ddata const")
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/intel_mid_powerbtn.c