Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [bug report] tty: serial: fsl_lpuart: fix DMA mapping
Date: Mon, 06 Apr 2020 16:48:31 +0200	[thread overview]
Message-ID: <6a2d4108095bafbd1a1f5580ddf97a4b@walle.cc> (raw)
In-Reply-To: <20200406144243.GB68494@mwanda>

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@walle.cc/

-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

      reply	other threads:[~2020-04-06 14:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-06 14:42 [bug report] tty: serial: fsl_lpuart: fix DMA mapping Dan Carpenter
2020-04-06 14:48 ` Michael Walle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a2d4108095bafbd1a1f5580ddf97a4b@walle.cc \
    --to=michael@walle.cc \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox