linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [net] ibmvnic: fix dma_mapping_error call
@ 2017-11-17 11:09 Desnes Augusto Nunes do Rosario
  2017-11-18  1:37 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Desnes Augusto Nunes do Rosario @ 2017-11-17 11:09 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, tlfalcon, nfont, jallen

This patch fixes the dma_mapping_error call to use the correct dma_addr
which is inside the ibmvnic_vpd struct. Moreover, it fixes an uninitialized
warning regarding a local dma_addr variable which is not used anymore.

Fixes: 4e6759be28e4 ("ibmvnic: Feature implementation of VPD for the ibmvnic driver")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Desnes A. Nunes do Rosario <desnesn@linux.vnet.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 04aaacb..1dc4aef 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -849,7 +849,6 @@ static int ibmvnic_get_vpd(struct ibmvnic_adapter *adapter)
 {
 	struct device *dev = &adapter->vdev->dev;
 	union ibmvnic_crq crq;
-	dma_addr_t dma_addr;
 	int len = 0;
 
 	if (adapter->vpd->buff)
@@ -879,7 +878,7 @@ static int ibmvnic_get_vpd(struct ibmvnic_adapter *adapter)
 	adapter->vpd->dma_addr =
 		dma_map_single(dev, adapter->vpd->buff, adapter->vpd->len,
 			       DMA_FROM_DEVICE);
-	if (dma_mapping_error(dev, dma_addr)) {
+	if (dma_mapping_error(dev, adapter->vpd->dma_addr)) {
 		dev_err(dev, "Could not map VPD buffer\n");
 		kfree(adapter->vpd->buff);
 		return -ENOMEM;
-- 
2.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [net] ibmvnic: fix dma_mapping_error call
  2017-11-17 11:09 [PATCH] [net] ibmvnic: fix dma_mapping_error call Desnes Augusto Nunes do Rosario
@ 2017-11-18  1:37 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-11-18  1:37 UTC (permalink / raw)
  To: desnesn; +Cc: netdev, linuxppc-dev, tlfalcon, nfont, jallen

From: Desnes Augusto Nunes do Rosario <desnesn@linux.vnet.ibm.com>
Date: Fri, 17 Nov 2017 09:09:04 -0200

> This patch fixes the dma_mapping_error call to use the correct dma_addr
> which is inside the ibmvnic_vpd struct. Moreover, it fixes an uninitialized
> warning regarding a local dma_addr variable which is not used anymore.
> 
> Fixes: 4e6759be28e4 ("ibmvnic: Feature implementation of VPD for the ibmvnic driver")
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Desnes A. Nunes do Rosario <desnesn@linux.vnet.ibm.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-18  1:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-17 11:09 [PATCH] [net] ibmvnic: fix dma_mapping_error call Desnes Augusto Nunes do Rosario
2017-11-18  1:37 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).