]> www.infradead.org Git - users/dwmw2/linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Feb 2020 21:53:01 +0000 (16:53 -0500)
commit08a36797bfdc08a3900ff628c1d1c60aac89a61c
treeadd68595404e551f2b10dbd9094559954dbfa32c
parent631dcf67384891a87fe62ab2fbcc1d898cdfcd70
platform/x86: intel_mid_powerbtn: Take a copy of ddata

commit 5e0c94d3aeeecc68c573033f08d9678fecf253bd upstream.

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: c94a8ff14de3 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/platform/x86/intel_mid_powerbtn.c