uio: fix potential memory leak in error case
authorChengguang Xu <cgxu519@gmx.com>
Thu, 17 Jan 2019 09:27:46 +0000 (17:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Jan 2019 11:03:16 +0000 (12:03 +0100)
Should jump to lable err_infoopen when idev->info is NULL
in uio_open().

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/uio/uio.c

index 131342280b467eb7f84028ee1a9a7cb2e6dc3cd6..46e5c1c31ebe73f62b50f66c2f69975d2c26a5c7 100644 (file)
@@ -491,7 +491,7 @@ static int uio_open(struct inode *inode, struct file *filep)
        if (!idev->info) {
                mutex_unlock(&idev->info_lock);
                ret = -EINVAL;
-               goto err_alloc_listener;
+               goto err_infoopen;
        }
 
        if (idev->info && idev->info->open)