Thread (2 messages) 2 messages, 2 authors, 2014-09-02

Re: [PATCH] VMXNET3: Check for map error in vmxnet3_set_mc

flat view

From: Sergei Shtylyov <hidden>
Date: 2014-09-02 20:02:41
Also in: lkml, virtualization

Hello.

On 09/02/2014 08:30 PM, Andy King wrote:
We should check if the map of the table actually succeeds, and also free
resources accordingly. This fixes the kernel panic reported by Tetsuo
Handa.
   There's "Reported-by:" line for that.
Version bumped to 1.2.1.0
Acked-by: Shelley Gong <redacted>
Acked-by: Bhavesh Davda <redacted>
Signed-off-by: Andy King <redacted>
---
  drivers/net/vmxnet3/vmxnet3_drv.c |   14 ++++++++------
  drivers/net/vmxnet3/vmxnet3_int.h |    4 ++--
  2 files changed, 10 insertions(+), 8 deletions(-)
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index d6e90c7..f450010 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
[...]
quoted hunk ↗ jump to hunk
@@ -2091,11 +2093,11 @@ vmxnet3_set_mc(struct net_device *netdev)
  			       VMXNET3_CMD_UPDATE_MAC_FILTERS);
  	spin_unlock_irqrestore(&adapter->cmd_lock, flags);

-	if (new_table) {
+	if (new_table_pa)
  		dma_unmap_single(&adapter->pdev->dev, new_table_pa,
  				 rxConf->mfTableLen, PCI_DMA_TODEVICE);
+	if (new_table)
  		kfree(new_table);
   The above *if* is not needed -- kfree() already checks for NULL.

[...]

WBR, Sergei
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help