RE: [PATCH V5 2/8] x86/hyperv: Set Virtual Trust Level in VMBus init message

From: Dexuan Cui
Date: Fri Aug 11 2023 - 18:16:28 EST


> From: Wei Liu <wei.liu@xxxxxxxxxx>
> Sent: Friday, August 11, 2023 2:15 PM
> To: Dexuan Cui <decui@xxxxxxxxxxxxx>
> > [...]
> > > + local_irq_save(flags);
> > > + input = *this_cpu_ptr(hyperv_pcpu_input_arg);
> > > + output = (struct hv_get_vp_registers_output *)input;
> > > + if (!input) {
> > > + local_irq_restore(flags);
> > > + goto done;
> >
> > Here the uninitialized 'ret' is returned.
> >
> > If we move the "done:" label one line earlier, we won't need the
> > the above " local_irq_restore(flags);"
> > Maybe we should add a WARN_ON_ONCE(1) before "goto done"?
>
> Out of interest why will input be NULL here?
>
> Thanks,
> Wei.

I don't think 'input' could be NULL here.
IMO we can use it without checking against NULL.