On Thu, Jan 22, 2026 at 08:17:22AM +0100, Jan Beulich wrote:
> On 21.01.2026 18:49, Roger Pau Monné wrote:
> > --- a/drivers/xen/balloon.c
> > +++ b/drivers/xen/balloon.c
> > @@ -724,7 +724,8 @@ static int __init balloon_add_regions(void)
> >  static int __init balloon_init(void)
> >  {
> >     struct task_struct *task;
> > -   unsigned long current_pages;
> > +   unsigned long current_pages = 0;
> 
> With this, ...
> 
> > @@ -732,8 +733,13 @@ static int __init balloon_init(void)
> >  
> >     pr_info("Initialising balloon driver\n");
> >  
> > -   current_pages = xen_pv_domain() ? min(xen_start_info->nr_pages, max_pfn)
> > -                                   : get_num_physpages();
> > +   if (xen_initial_domain())
> > +           current_pages = HYPERVISOR_memory_op(XENMEM_current_reservation,
> > +                                                &domid);
> > +   if (current_pages <= 0)
> 
> ... why <= ? Gives the impression you may mean to cover HYPERVISOR_memory_op()
> returning an error, yet that'll require a signed long variable then.

Oh, indeed, current_pages should be signed long.  This was an untested
mash-up of a slightly different patch, where I didn't realize that
current_pages was unsigned.

Thanks, Roger.

Reply via email to