summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4file.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-05 08:03:23 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-05 08:03:23 +0200
commita956f91247da3fe71e4d5f7da1f6dd8bae7c3c21 (patch)
treedcbfa79369938f1349af5b39a68dee698861a815 /fs/nfs/nfs4file.c
parentUSB: hcd-pci: Drop the unused id parameter from usb_hcd_pci_probe() (diff)
parentLinux 6.0-rc4 (diff)
downloadlinux-a956f91247da3fe71e4d5f7da1f6dd8bae7c3c21.tar.xz
linux-a956f91247da3fe71e4d5f7da1f6dd8bae7c3c21.zip
Merge 6.0-rc4 into usb-next
We need the USB fixes in here and this resolves the merge issue in: drivers/usb/dwc3/gadget.c Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/nfs/nfs4file.c')
-rw-r--r--fs/nfs/nfs4file.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
index e88f6b18445e..9eb181287879 100644
--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -340,6 +340,11 @@ static struct file *__nfs42_ssc_open(struct vfsmount *ss_mnt,
goto out;
}
+ if (!S_ISREG(fattr->mode)) {
+ res = ERR_PTR(-EBADF);
+ goto out;
+ }
+
res = ERR_PTR(-ENOMEM);
len = strlen(SSC_READ_NAME_BODY) + 16;
read_name = kzalloc(len, GFP_KERNEL);
@@ -357,6 +362,7 @@ static struct file *__nfs42_ssc_open(struct vfsmount *ss_mnt,
r_ino->i_fop);
if (IS_ERR(filep)) {
res = ERR_CAST(filep);
+ iput(r_ino);
goto out_free_name;
}