Message ID | 1397037885-21060-1-git-send-email-Gang.Liu@freescale.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Scott Wood |
Headers | show |
Hi Scott, Do you have some comments about this patch, or would you please help to apply it? Thanks a lot! Liu Gang > -----Original Message----- > From: Liu Gang [mailto:Gang.Liu@freescale.com] > Sent: Wednesday, April 09, 2014 6:05 PM > To: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421 > Cc: Zang Roy-R61911; Liu Gang-B34182 > Subject: [PATCH] powerpc/rmu: Fix the error memory free parameters > > There are error parameters should be corrected when calling > dma_free_coherent to free rmu rx-ring buffers in fsl_open_inb_mbox() > function. > > Signed-off-by: Liu Gang <Gang.Liu@freescale.com> > Reported-by: Dan Carpenter <dan.carpenter@oracle.com> > --- > arch/powerpc/sysdev/fsl_rmu.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/powerpc/sysdev/fsl_rmu.c > b/arch/powerpc/sysdev/fsl_rmu.c index 00e224a..b48197a 100644 > --- a/arch/powerpc/sysdev/fsl_rmu.c > +++ b/arch/powerpc/sysdev/fsl_rmu.c > @@ -881,9 +881,9 @@ fsl_open_inb_mbox(struct rio_mport *mport, void > *dev_id, int mbox, int entries) > rc = request_irq(IRQ_RIO_RX(mport), fsl_rio_rx_handler, 0, > "msg_rx", (void *)mport); > if (rc < 0) { > - dma_free_coherent(priv->dev, RIO_MSG_BUFFER_SIZE, > - rmu->msg_tx_ring.virt_buffer[i], > - rmu->msg_tx_ring.phys_buffer[i]); > + dma_free_coherent(priv->dev, > + rmu->msg_rx_ring.size * RIO_MAX_MSG_SIZE, > + rmu->msg_rx_ring.virt, rmu->msg_rx_ring.phys); > goto out; > } > > -- > 1.8.5 >
diff --git a/arch/powerpc/sysdev/fsl_rmu.c b/arch/powerpc/sysdev/fsl_rmu.c index 00e224a..b48197a 100644 --- a/arch/powerpc/sysdev/fsl_rmu.c +++ b/arch/powerpc/sysdev/fsl_rmu.c @@ -881,9 +881,9 @@ fsl_open_inb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries) rc = request_irq(IRQ_RIO_RX(mport), fsl_rio_rx_handler, 0, "msg_rx", (void *)mport); if (rc < 0) { - dma_free_coherent(priv->dev, RIO_MSG_BUFFER_SIZE, - rmu->msg_tx_ring.virt_buffer[i], - rmu->msg_tx_ring.phys_buffer[i]); + dma_free_coherent(priv->dev, + rmu->msg_rx_ring.size * RIO_MAX_MSG_SIZE, + rmu->msg_rx_ring.virt, rmu->msg_rx_ring.phys); goto out; }
There are error parameters should be corrected when calling dma_free_coherent to free rmu rx-ring buffers in fsl_open_inb_mbox() function. Signed-off-by: Liu Gang <Gang.Liu@freescale.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> --- arch/powerpc/sysdev/fsl_rmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)