serial_write_dma: prevent memory leak when busy
This commit is contained in:
parent
7bee3f694b
commit
aa722fc34f
1 changed files with 2 additions and 2 deletions
|
@ -99,11 +99,11 @@ ssize_t serial_write_dma(struct serial_device *dev, struct dmabuf *buf)
|
|||
uint16_t len;
|
||||
struct arch_serial_device *arch_dev = to_arch_serial_device(dev);
|
||||
|
||||
dmabuf_get(buf);
|
||||
|
||||
if (arch_dev->tx_next != NULL)
|
||||
return -EBUSY;
|
||||
|
||||
dmabuf_get(buf);
|
||||
|
||||
if (buf->len >= 0xffff)
|
||||
len = 0xffff;
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue