lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Mon, 9 Dec 2019 02:44:06 +0000
From:   linmiaohe <linmiaohe@...wei.com>
To:     Matthew Wilcox <willy@...radead.org>
CC:     Davide Libenzi <davidel@...ilserver.org>,
        "viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] fs: eventfd: fix obsolete comment

Matthew Wilcox <willy@...radead.org> wrote:
>On Sat, Dec 07, 2019 at 03:45:33PM +0800, linmiaohe wrote:
>> From: Miaohe Lin <linmiaohe@...wei.com>
>> 
>>   *
>> - * eventfd_fget
>> + * fdget
>
>But this is wrong.  The error pointer is returned from eventfd_ctx_fileget(), not from fdget.
>
>Looking at the three callers of eventfd_ctx_fileget(), I think it would make sense to do this:

Many thanks for your review and nice advice. But I think this patch should belong to you as you found this.
I really did nothing about it. Maybe a Reviewed-by tag for me is enough.

>diff --git a/drivers/vfio/virqfd.c b/drivers/vfio/virqfd.c index 997cb5d0a657..c35b614e3770 100644
>--- a/drivers/vfio/virqfd.c
>+++ b/drivers/vfio/virqfd.c
>@@ -126,11 +126,6 @@ int vfio_virqfd_enable(void *opaque,
> 	INIT_WORK(&virqfd->inject, virqfd_inject);
> 
> 	irqfd = fdget(fd);
>-	if (!irqfd.file) {
>-		ret = -EBADF;
>-		goto err_fd;
>-	}
>-
> 	ctx = eventfd_ctx_fileget(irqfd.file);
> 	if (IS_ERR(ctx)) {
> 		ret = PTR_ERR(ctx);

The err_fd label should further be removed, as after this change, it's no longer used.
Other callers should drop unused jump label too.

>(not even compile tested)

Thanks again.

Powered by blists - more mailing lists