]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
x86/platform/intel-mid: Revert "Make 'bt_sfi_data' const"
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 28 Dec 2017 12:25:23 +0000 (14:25 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 8 Jan 2018 19:01:44 +0000 (20:01 +0100)
commit9d0513d82f1a8fe17b41f113ac5922fa57dbaf5c
tree145a8b0de384b24243a98baf76588cd611ed857e
parentb94b7373317164402ff7728d10f7023127a02b60
x86/platform/intel-mid: Revert "Make 'bt_sfi_data' const"

So one of the constification patches unearthed a type casting fragility
of the underlying code:

  276c87054751 ("x86/platform/intel-mid: Make 'bt_sfi_data' const")

converted the struct to be const while it is also used as a temporary
container for important data that is used to fill 'parent' and 'name'
fields in struct platform_device_info.

The compiler doesn't notice this due to an explicit type cast that loses
the const - which fragility will be fixed separately.

This type cast turned a seemingly trivial const propagation patch into a
hard to debug data corruptor and crasher bug.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Bhumika Goyal <bhumirks@gmail.com>
Cc: Darren Hart <dvhart@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: julia.lawall@lip6.fr
Cc: platform-driver-x86@vger.kernel.org
Link: http://lkml.kernel.org/r/20171228122523.21802-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/platform/intel-mid/device_libs/platform_bt.c