serial_write_dma: prevent memory leak when busy

This commit is contained in:
anna 2021-08-01 23:51:19 +02:00
parent 7bee3f694b
commit aa722fc34f
Signed by: fef
GPG key ID: EC22E476DC2D3D84

View file

@ -99,11 +99,11 @@ ssize_t serial_write_dma(struct serial_device *dev, struct dmabuf *buf)
uint16_t len; uint16_t len;
struct arch_serial_device *arch_dev = to_arch_serial_device(dev); struct arch_serial_device *arch_dev = to_arch_serial_device(dev);
dmabuf_get(buf);
if (arch_dev->tx_next != NULL) if (arch_dev->tx_next != NULL)
return -EBUSY; return -EBUSY;
dmabuf_get(buf);
if (buf->len >= 0xffff) if (buf->len >= 0xffff)
len = 0xffff; len = 0xffff;
else else