Commit 6f2bf9c5 authored by Oleksandr Ocheretnyi's avatar Oleksandr Ocheretnyi Committed by Greg Kroah-Hartman
Browse files

mtd: fix 'part' field data corruption in mtd_info



[ Upstream commit 37c5f9e8 ]

Commit 46b5889c ("mtd: implement proper partition handling")
started using "mtd_get_master_ofs()" in mtd callbacks to determine
memory offsets by means of 'part' field from mtd_info, what previously
was smashed accessing 'master' field in the mtd_set_dev_defaults() method.
That provides wrong offset what causes hardware access errors.

Just make 'part', 'master' as separate fields, rather than using
union type to avoid 'part' data corruption when mtd_set_dev_defaults()
is called.

Fixes: 46b5889c ("mtd: implement proper partition handling")
Signed-off-by: default avatarOleksandr Ocheretnyi <oocheret@cisco.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220417184649.449289-1-oocheret@cisco.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 4da42103
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment