mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
usb/gadget/f_fs: fix invalid ffs to cause ramdump
QC patch("usb: gadget: f_fs: Fix NULL pointer issues in ffs driver")
fix multiple mounted issue, it will return "ERR_PTR(-EBUSY)" in
ffs_data_new(), but ffs driver only check ffs if is a NULL point,
the next code using ffs still cause ramdump.
origin-CR: (CR)
Change-Id: Ib2d21b2854163883f07475ef97e1e09a1742c617
Reviewed-on: https://gerrit.mot.com/1313122
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-by: Yuecai Liu <liuyc20@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1338906
Reviewed-on: https://gerrit.mot.com/1449057
Reviewed-on: https://gerrit.mot.com/1751135
Reviewed-by: Xiaojun Ji <jixj@motorola.com>
Reviewed-on: https://gerrit.mot.com/1785338
This commit is contained in:
parent
315a01917e
commit
670e79efe6
1 changed files with 4 additions and 0 deletions
|
|
@ -1768,6 +1768,7 @@ static int ffs_fs_get_tree(struct fs_context *fc)
|
|||
return invalf(fc, "No source specified");
|
||||
|
||||
ffs = ffs_data_new(fc->source);
|
||||
|
||||
if (IS_ERR_OR_NULL(ffs)) {
|
||||
if (!ffs)
|
||||
return -ENOMEM;
|
||||
|
|
@ -1775,6 +1776,9 @@ static int ffs_fs_get_tree(struct fs_context *fc)
|
|||
return PTR_ERR(ffs);
|
||||
}
|
||||
|
||||
if (IS_ERR(ffs))
|
||||
return PTR_ERR(ffs);
|
||||
|
||||
ffs->file_perms = ctx->perms;
|
||||
ffs->no_disconnect = ctx->no_disconnect;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue