Commit Graph

2 Commits

Author SHA1 Message Date
Heinrich Schuchardt 1759abcc94 UPSTREAM: fs: avoid possible NULL dereference in fs_devread
It is unwise to first dereference a variable
and then to check if it was NULL.

Change-Id: I2c28e092380c649874fab06f0b4e453466e2d16c
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Marek Behun <marek.behun@nic.cz>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 24f48416dfe1d827dcf759d6cd0e7a8e5c67e321)
2018-01-17 15:27:28 +08:00
Marek Behún 9f816917d2 UPSTREAM: fs: Create a common fs_devread for ext4/reiserfs/zfs
The ext4, reiserfs and zfs filesystems all have their own implementation
of the same function, *_devread. Generalize this function into fs_devread
and put the code into fs/fs_internal.c.

Change-Id: Ib558f0f40ba1520f4974ca5cbd31265573b156c9
Signed-off-by: Marek Behun <marek.behun@nic.cz>
[trini: Move fs/fs_internal.o hunk to the end of fs/Makefile as all
cases need it]
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 5994e8b6432d1c6df1cad44771f02054dba893ff)
2018-01-17 15:27:28 +08:00