This pull request contains updates for JFFS2, UBI and UBIFS

	- Fix memory corruption in error path
	- Spelling and coding style fixes

	- Switch to BLK_MQ_F_BLOCKING in ubiblock
	- Wire up partent device (for sysfs)
	- Multiple UAF bugfixes
	- Fix for an infinite loop in WL error path

	- Fix for multiple memory leaks in error paths
	- Fixes for wrong space accounting
	- Minor cleanups
	- Spelling and coding style fixes
ubi: block: Fix a possible use-after-free bug in ubiblock_create()

Smatch warns:
	drivers/mtd/ubi/block.c:438 ubiblock_create()
	warn: '&dev->list' not removed from list

'dev' is freed in 'out_free_dev:, but it is still on the list.

To fix this, delete the list item before freeing.

Fixes: 91cc8fbcc8c7 ("ubi: block: set BLK_MQ_F_BLOCKING")
Signed-off-by: Harshit Mogalapalli <>
Reviewed-by: Christoph Hellwig <>
Signed-off-by: Richard Weinberger <>
1 file changed