提交 ccf31c10 编写于 作者: D Dan Carpenter 提交者: Joern Engel

logfs: handle errors from get_mtd_device()

The get_mtd_device() function returns error pointers on failure and if we
don't handle it, it leads to a crash.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NJoern Engel <joern@logfs.org>
上级 58e323cf
......@@ -250,5 +250,7 @@ int logfs_get_sb_mtd(struct file_system_type *type, int flags,
const struct logfs_device_ops *devops = &mtd_devops;
mtd = get_mtd_device(NULL, mtdnr);
if (IS_ERR(mtd))
return PTR_ERR(mtd);
return logfs_get_sb_device(type, flags, mtd, NULL, devops, mnt);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册