Re: [PATCH] tracing: initialize variable in create_dyn_event()

From: Frank Rowand
Date: Fri Mar 15 2019 - 11:56:50 EST


On 3/14/19 4:26 PM, Masami Hiramatsu wrote:
> Hi Frank and Steve,
>
> Thank you for pointing it out :)
>
> On Thu, 14 Mar 2019 18:19:08 -0400
> Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
>> On Thu, 14 Mar 2019 14:05:02 -0700
>> Frank Rowand <frowand.list@xxxxxxxxx> wrote:
>>
>>> Hi Steve,
>>>
>>> Ping.
>>
>> Thanks, this got buried.
>>
>>>> static int create_dyn_event(int argc, char **argv)
>>>> {
>>>> struct dyn_event_operations *ops;
>>>> - int ret;
>>>> + int ret = 0;
>>
>> Probably should be ret = -ENODEV;
>>
>> As if ret doesn't get set, then no dynamic code has been registered,
>> and something is truly wrong.
>
> I Agreed to return -ENODEV instead of 0.
>
> Thank you,
>
>>
>> -- Steve
>>
>>
>>>>
>>>> if (argv[0][0] == '-' || argv[0][0] == '!')
>>>> return dyn_event_release(argc, argv, NULL);
>>>>
>>
>
>

Thanks, I'll fix and resend.