On (12/12/18 10:07), Peter Zijlstra wrote:
> > +   uart_port_lock(state, flags);
> > +   xmit_buf = state->xmit.buf;
> > +   state->xmit.buf = NULL;
> > +   uart_port_unlock(uport, flags);
> > +
> >     /*
> >      * Free the transmit buffer page.
> >      */
> > -   uart_port_lock(state, flags);
> > -   if (state->xmit.buf) {
> > -           free_page((unsigned long)state->xmit.buf);
> > -           state->xmit.buf = NULL;
> > -   }
> > -   uart_port_unlock(uport, flags);
> > +   if (xmit_buf)
> > +           free_page((unsigned long)xmit_buf);
> >  }
> 
> That looks sensible anyhow. One should strive to not do alloc or free
> under locks as much as possible anyway.

Right, good point.

        -ss

Reply via email to