Merge "usb: f_fs: Avoid invalid pointer access in ffs_fs_get_tree"

This commit is contained in:
qctecmdr 2021-04-02 01:31:15 -07:00 • committed by Gerrit - the friendly Code Review server
commit a1610d79d6

View file

@ -1760,8 +1760,13 @@ static int ffs_fs_get_tree(struct fs_context *fc)
return invalf(fc, "No source specified");
ffs = ffs_data_new(fc->source);
if (unlikely(!ffs))
return -ENOMEM;
if (IS_ERR_OR_NULL(ffs)) {
if (!ffs)
return -ENOMEM;
else
return PTR_ERR(ffs);
}
ffs->file_perms = ctx->perms;
ffs->no_disconnect = ctx->no_disconnect;