public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: fix uninitialized return
@ 2022-02-07 18:51 trix
  2022-02-07 19:48 ` Nick Desaulniers
  0 siblings, 1 reply; 3+ messages in thread
From: trix @ 2022-02-07 18:51 UTC (permalink / raw)
  To: axboe, asml.silence, nathan, ndesaulniers, usama.arif
  Cc: io-uring, linux-kernel, llvm, Tom Rix

From: Tom Rix <[email protected]>

The clang build fails with this error
io_uring.c:9396:9: error: variable 'ret' is uninitialized when used here
        return ret;
               ^~~~
Return 0 directly.

Fixes: b77e315a9644 ("io_uring: avoid ring quiesce while registering/unregistering eventfd")
Signed-off-by: Tom Rix <[email protected]>
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index aadabb31d6da7..74afb96af214c 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -9393,7 +9393,7 @@ static int io_eventfd_register(struct io_ring_ctx *ctx, void __user *arg,
 	ev_fd->eventfd_async = eventfd_async;
 
 	rcu_assign_pointer(ctx->io_ev_fd, ev_fd);
-	return ret;
+	return 0;
 }
 
 static void io_eventfd_put(struct rcu_head *rcu)
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] io_uring: fix uninitialized return
  2022-02-07 18:51 [PATCH] io_uring: fix uninitialized return trix
@ 2022-02-07 19:48 ` Nick Desaulniers
  2022-02-07 20:09   ` Tom Rix
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Desaulniers @ 2022-02-07 19:48 UTC (permalink / raw)
  To: trix; +Cc: axboe, asml.silence, nathan, usama.arif, io-uring, linux-kernel,
	llvm

On Mon, Feb 7, 2022 at 10:51 AM <[email protected]> wrote:
>
> From: Tom Rix <[email protected]>
>
> The clang build fails with this error
> io_uring.c:9396:9: error: variable 'ret' is uninitialized when used here
>         return ret;
>                ^~~~
> Return 0 directly.
>
> Fixes: b77e315a9644 ("io_uring: avoid ring quiesce while registering/unregistering eventfd")
> Signed-off-by: Tom Rix <[email protected]>

Thanks for the patch:
See also:
https://lore.kernel.org/llvm/[email protected]/

> ---
>  fs/io_uring.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index aadabb31d6da7..74afb96af214c 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -9393,7 +9393,7 @@ static int io_eventfd_register(struct io_ring_ctx *ctx, void __user *arg,
>         ev_fd->eventfd_async = eventfd_async;
>
>         rcu_assign_pointer(ctx->io_ev_fd, ev_fd);
> -       return ret;
> +       return 0;
>  }
>
>  static void io_eventfd_put(struct rcu_head *rcu)
> --
> 2.26.3
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] io_uring: fix uninitialized return
  2022-02-07 19:48 ` Nick Desaulniers
@ 2022-02-07 20:09   ` Tom Rix
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Rix @ 2022-02-07 20:09 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: axboe, asml.silence, nathan, usama.arif, io-uring, linux-kernel,
	llvm


On 2/7/22 11:48 AM, Nick Desaulniers wrote:
> On Mon, Feb 7, 2022 at 10:51 AM <[email protected]> wrote:
>> From: Tom Rix <[email protected]>
>>
>> The clang build fails with this error
>> io_uring.c:9396:9: error: variable 'ret' is uninitialized when used here
>>          return ret;
>>                 ^~~~
>> Return 0 directly.
>>
>> Fixes: b77e315a9644 ("io_uring: avoid ring quiesce while registering/unregistering eventfd")
>> Signed-off-by: Tom Rix <[email protected]>
> Thanks for the patch:
> See also:
> https://lore.kernel.org/llvm/[email protected]/

No worries as long as it gets fixed.

Tom

>
>> ---
>>   fs/io_uring.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/io_uring.c b/fs/io_uring.c
>> index aadabb31d6da7..74afb96af214c 100644
>> --- a/fs/io_uring.c
>> +++ b/fs/io_uring.c
>> @@ -9393,7 +9393,7 @@ static int io_eventfd_register(struct io_ring_ctx *ctx, void __user *arg,
>>          ev_fd->eventfd_async = eventfd_async;
>>
>>          rcu_assign_pointer(ctx->io_ev_fd, ev_fd);
>> -       return ret;
>> +       return 0;
>>   }
>>
>>   static void io_eventfd_put(struct rcu_head *rcu)
>> --
>> 2.26.3
>>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-07 20:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-07 18:51 [PATCH] io_uring: fix uninitialized return trix
2022-02-07 19:48 ` Nick Desaulniers
2022-02-07 20:09   ` Tom Rix

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox