aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-07-22 15:04:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-07-22 15:04:51 -0400
commit165ea0d1c2286f550efbf14dc3528267af088f08 (patch)
tree913ef8a34b31056ad13f04ec1dbb38a092974d88 /drivers/gpu
parentf88a333b44318643282b8acc92af90deda441f5e (diff)
parent9ba546c01976a426292af99e682a557075d6c010 (diff)
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs fixes from Al Viro: "Fix several places that screw up cleanups after failures halfway through opening a file (one open-coding filp_clone_open() and getting it wrong, two misusing alloc_file()). That part is -stable fodder from the 'work.open' branch. And Christoph's regression fix for uapi breakage in aio series; include/uapi/linux/aio_abi.h shouldn't be pulling in the kernel definition of sigset_t, the reason for doing so in the first place had been bogus - there's no need to expose struct __aio_sigset in aio_abi.h at all" * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: aio: don't expose __aio_sigset in uapi ocxlflash_getfile(): fix double-iput() on alloc_file() failures cxl_getfile(): fix double-iput() on alloc_file() failures drm_mode_create_lease_ioctl(): fix open-coded filp_clone_open()
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/drm_lease.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 50c73c0a20b9..d638c0fb3418 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -553,24 +553,13 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
553 553
554 /* Clone the lessor file to create a new file for us */ 554 /* Clone the lessor file to create a new file for us */
555 DRM_DEBUG_LEASE("Allocating lease file\n"); 555 DRM_DEBUG_LEASE("Allocating lease file\n");
556 path_get(&lessor_file->f_path); 556 lessee_file = filp_clone_open(lessor_file);
557 lessee_file = alloc_file(&lessor_file->f_path,
558 lessor_file->f_mode,
559 fops_get(lessor_file->f_inode->i_fop));
560
561 if (IS_ERR(lessee_file)) { 557 if (IS_ERR(lessee_file)) {
562 ret = PTR_ERR(lessee_file); 558 ret = PTR_ERR(lessee_file);
563 goto out_lessee; 559 goto out_lessee;
564 } 560 }
565 561
566 /* Initialize the new file for DRM */
567 DRM_DEBUG_LEASE("Initializing the file with %p\n", lessee_file->f_op->open);
568 ret = lessee_file->f_op->open(lessee_file->f_inode, lessee_file);
569 if (ret)
570 goto out_lessee_file;
571
572 lessee_priv = lessee_file->private_data; 562 lessee_priv = lessee_file->private_data;
573
574 /* Change the file to a master one */ 563 /* Change the file to a master one */
575 drm_master_put(&lessee_priv->master); 564 drm_master_put(&lessee_priv->master);
576 lessee_priv->master = lessee; 565 lessee_priv->master = lessee;
@@ -588,9 +577,6 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
588 DRM_DEBUG_LEASE("drm_mode_create_lease_ioctl succeeded\n"); 577 DRM_DEBUG_LEASE("drm_mode_create_lease_ioctl succeeded\n");
589 return 0; 578 return 0;
590 579
591out_lessee_file:
592 fput(lessee_file);
593
594out_lessee: 580out_lessee:
595 drm_master_put(&lessee); 581 drm_master_put(&lessee);
596 582