Re: [PATCH net v4] selftest:net: Fix uninit return values
From: Sidharth Seela
Date: Tue Sep 30 2025 - 07:57:33 EST
On Tue, Sep 30, 2025 at 4:50 PM Antonio Quartulli <antonio@xxxxxxxxxxx> wrote:
> Hi,
> Thanks a lot for fixing this - I hadn't see the warnings with gcc.
I am glad, thankyou.
> ret goes uninitialized only under the "if (!sock)" condition, therefore
> I'd rather assign ret a meaningful value instead of -1.
Yes, you are right.
> How about adding "err = -ENOMEM;" directly inside the if block?
> Same here.
> ret goes uninitialized only under the "CMD_INVALID" case.
> How about adding "ret = -EINVAL;" inside the affected case?
> Both values are returned by ovpn_run_cmd() and then printed as
> strerror(-ret).
> If we blindly use -1 we will get "Operation not permitted" which will
> confuse the user IMHO.
Alright, understood, Thank you.
Sending in the changes in v5.
--
Thanks,
Sidharth Seela
www.realtimedesign.org