ANDROID: incremental-fs: fix GPF in pending_reads_dispatch_ioctl
It is possible that fget returns NULL. This needs to be handled correctly in ioctl_permit_fill. Bug: 212821226 Signed-off-by: Tadeusz Struk <tadeusz.struk@linaro.org> Change-Id: Iec8be21982afeab6794b78ab1a542671c52acea2
This commit is contained in:
@@ -147,8 +147,12 @@ static long ioctl_permit_fill(struct file *f, void __user *arg)
|
|||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
file = fget(permit_fill.file_descriptor);
|
file = fget(permit_fill.file_descriptor);
|
||||||
if (IS_ERR(file))
|
if (IS_ERR_OR_NULL(file)) {
|
||||||
|
if (!file)
|
||||||
|
return -ENOENT;
|
||||||
|
|
||||||
return PTR_ERR(file);
|
return PTR_ERR(file);
|
||||||
|
}
|
||||||
|
|
||||||
if (file->f_op != &incfs_file_ops) {
|
if (file->f_op != &incfs_file_ops) {
|
||||||
error = -EPERM;
|
error = -EPERM;
|
||||||
|
Reference in New Issue
Block a user