]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: Check add_mtd_device() ret code
authorBoris Brezillon <bbrezillon@kernel.org>
Wed, 2 Jan 2019 14:36:54 +0000 (15:36 +0100)
committerBoris Brezillon <bbrezillon@kernel.org>
Mon, 7 Jan 2019 13:06:24 +0000 (14:06 +0100)
commit07682489164d5a073df53a4bff02e73fe9bf9cd6
tree57f2eccaf21d13cafbb2b499639ed5546d342283
parent76413828811f9a0a459f0e5d66186da65247ef07
mtd: Check add_mtd_device() ret code

add_mtd_device() can fail. We should always check its return value
and gracefully handle the failure case. Fix the call sites where this
not done (in mtdpart.c) and add a __must_check attribute to the
prototype to avoid this kind of mistakes.

Signed-off-by: Boris Brezillon <bbrezillon@kernel.org>
drivers/mtd/mtdcore.h
drivers/mtd/mtdpart.c