On Wed, Mar 25, 2026 at 03:52:37PM +0900, Simon Richter wrote:
> Hi Bjorn,
> 
> On 3/25/26 4:37 AM, Bjorn Helgaas wrote:
> 
> > > If VGA routing cannot be established, vga_get_uninterruptible() returns an
> > > error and does not increment the lock count. Pass the error on, and don't
> > > call vga_put() when userspace closes the handle.
> 
> > I applied this, but I'm a little confused about the "don't call
> > vga_put() when userspace closes the handle" part.  Does that happen in
> > this patch and I'm just missing it?  This patch changes the "lock"
> > case, and the only vga_put() call I see is in the "unlock" case.
> 
> By not locking, we're not incrementing uc->io_cnt and uc->mem_cnt, so the
> release will not call vga_put().

Thanks, added this to the commit log:

  If VGA routing cannot be established, vga_get_uninterruptible() returns an
  error and does not increment the lock count. Return the error to the
  caller.

  Return before incrementing uc->io_cnt/mem_cnt so vga_arb_release() won't
  call vga_put() when userspace closes the handle.

Reply via email to