From 6a1944be76323f3bd6235ba7a552d3e84c1dabaa Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Thu, 24 Nov 2011 11:20:58 +1100 Subject: [PATCH] Revert "iio: fix a leak due to improper use of anon_inode_getfd()" This reverts commit b46413367961c2e8bd827e067a231be982aaeee2. --- drivers/staging/iio/industrialio-core.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/staging/iio/industrialio-core.c b/drivers/staging/iio/industrialio-core.c index 26564094e33b..326e967d54ef 100644 --- a/drivers/staging/iio/industrialio-core.c +++ b/drivers/staging/iio/industrialio-core.c @@ -242,8 +242,6 @@ static const struct file_operations iio_event_chrdev_fileops = { static int iio_event_getfd(struct iio_dev *indio_dev) { - int fd; - if (indio_dev->event_interface == NULL) return -ENODEV; @@ -254,15 +252,9 @@ static int iio_event_getfd(struct iio_dev *indio_dev) return -EBUSY; } mutex_unlock(&indio_dev->event_interface->event_list_lock); - fd = anon_inode_getfd("iio:event", + return anon_inode_getfd("iio:event", &iio_event_chrdev_fileops, indio_dev->event_interface, O_RDONLY); - if (fd < 0) { - mutex_lock(&indio_dev->event_interface->event_list_lock); - clear_bit(IIO_BUSY_BIT_POS, &ev_int->flags); - mutex_unlock(&indio_dev->event_interface->event_list_lock); - } - return fd; } static int __init iio_init(void) -- 2.39.5