Re: [bug report] tty: serial: fsl_lpuart: fix DMA mapping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 2020-04-06 16:42, schrieb Dan Carpenter:
Hello Michael Walle,

This is a semi-automatic email about new static checker warnings.

Thanks, fix is pending, see here:
https://lore.kernel.org/linux-serial/20200403174942.9594-1-michael@xxxxxxxx/

-michael


The patch a092ab25fdaa: "tty: serial: fsl_lpuart: fix DMA mapping"
from Mar 6, 2020, leads to the following Smatch complaint:

    drivers/tty/serial/fsl_lpuart.c:1237 lpuart_dma_rx_free()
    error: we previously assumed 'chan' could be null (see line 1234)

drivers/tty/serial/fsl_lpuart.c
  1228  static void lpuart_dma_rx_free(struct uart_port *port)
  1229  {
  1230          struct lpuart_port *sport = container_of(port,
1231 struct lpuart_port, port);
  1232          struct dma_chan *chan = sport->dma_rx_chan;
  1233
  1234		if (chan)
                    ^^^^
The patch adds a check

  1235			dmaengine_terminate_all(chan);
  1236
1237 dma_unmap_sg(chan->device->dev, &sport->rx_sgl, 1, DMA_FROM_DEVICE);
                             ^^^^^^
and an unchecked dereference.

  1238		kfree(sport->rx_ring.buf);
  1239		sport->rx_ring.tail = 0;

regards,
dan carpenter



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux