mtd: rawnand: diskonchip: Allocate rs control per instance
authorThomas Gleixner <tglx@linutronix.de>
Sun, 22 Apr 2018 16:23:54 +0000 (18:23 +0200)
committerKees Cook <keescook@chromium.org>
Wed, 25 Apr 2018 02:50:09 +0000 (19:50 -0700)
commit964dfce9c2b323a9a9d0bd6764e0f530b40104e4
treef8d6795fe6f37ac9f2ba4083c14cad22d5a9b354
parent2163398192f6a53e84765cfe3e5a2088437c3d2d
mtd: rawnand: diskonchip: Allocate rs control per instance

The reed solomon library is moving the on stack decoder buffers into the rs
control structure. That would break the DoC driver because multiple
instances share the same control structure and can operate in parallel. At
least in theory....

Instantiate a rs control instance per DoC device to avoid that. The per
instance buffer is fine as the operation on a single DoC instance is
serialized by the MTD/NAND core.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Kernel Hardening <kernel-hardening@lists.openwall.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Anton Vorontsov <anton@enomsg.org>
Cc: Colin Cross <ccross@android.com>
Cc: Andrew Morton <akpm@linuxfoundation.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Alasdair Kergon <agk@redhat.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
drivers/mtd/nand/raw/diskonchip.c