ubi: Fix race condition between ubi device creation and udev
authorIosif Harutyunov <iharutyunov@SonicWALL.com>
Fri, 22 Jul 2016 23:22:42 +0000 (23:22 +0000)
committerSasha Levin <alexander.levin@verizon.com>
Sat, 20 Aug 2016 03:07:58 +0000 (23:07 -0400)
commitae32d1b98ba29408df87c0ed47877ca0f248eae7
tree669a669d262d96411a80db4f33c61bb3f317db96
parenteb61bdda28b0fc1b7bea16919e0d34a9702d30e2
ubi: Fix race condition between ubi device creation and udev

[ Upstream commit 714fb87e8bc05ff78255afc0dca981e8c5242785 ]

Install the UBI device object before we arm sysfs.
Otherwise udev tries to read sysfs attributes before UBI is ready and
udev rules will not match.

Cc: <stable@vger.kernel.org>
Signed-off-by: Iosif Harutyunov <iharutyunov@sonicwall.com>
[rw: massaged commit message]
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/mtd/ubi/build.c