* [PATCH 0/3]netxen: bug fixes
@ 2010-06-14 9:39 Amit Kumar Salecha
2010-06-14 9:39 ` [PATCH 1/3] netxen: fix memory leaks in error path Amit Kumar Salecha
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Amit Kumar Salecha @ 2010-06-14 9:39 UTC (permalink / raw)
To: davem; +Cc: netdev, ameen.rahman
Hi
Sending series of 3 bug fixes. Please apply them on net-2.6.
-Amit
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] netxen: fix memory leaks in error path
2010-06-14 9:39 [PATCH 0/3]netxen: bug fixes Amit Kumar Salecha
@ 2010-06-14 9:39 ` Amit Kumar Salecha
2010-06-14 9:39 ` [PATCH 2/3] netxen: fix rcv buffer leak Amit Kumar Salecha
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Amit Kumar Salecha @ 2010-06-14 9:39 UTC (permalink / raw)
To: davem; +Cc: netdev, ameen.rahman
Fixes memory leak in error path when memory allocation
for adapter data structures fails.
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
drivers/net/netxen/netxen_nic_ctx.c | 3 ++-
drivers/net/netxen/netxen_nic_init.c | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c
index f26e547..3a41b6a 100644
--- a/drivers/net/netxen/netxen_nic_ctx.c
+++ b/drivers/net/netxen/netxen_nic_ctx.c
@@ -629,7 +629,8 @@ int netxen_alloc_hw_resources(struct netxen_adapter *adapter)
if (addr == NULL) {
dev_err(&pdev->dev, "%s: failed to allocate tx desc ring\n",
netdev->name);
- return -ENOMEM;
+ err = -ENOMEM;
+ goto err_out_free;
}
tx_ring->desc_head = (struct cmd_desc_type0 *)addr;
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 045a7c8..e08527f 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -218,7 +218,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
if (cmd_buf_arr == NULL) {
dev_err(&pdev->dev, "%s: failed to allocate cmd buffer ring\n",
netdev->name);
- return -ENOMEM;
+ goto err_out;
}
memset(cmd_buf_arr, 0, TX_BUFF_RINGSIZE(tx_ring));
tx_ring->cmd_buf_arr = cmd_buf_arr;
@@ -230,7 +230,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
if (rds_ring == NULL) {
dev_err(&pdev->dev, "%s: failed to allocate rds ring struct\n",
netdev->name);
- return -ENOMEM;
+ goto err_out;
}
recv_ctx->rds_rings = rds_ring;
--
1.6.0.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] netxen: fix rcv buffer leak
2010-06-14 9:39 [PATCH 0/3]netxen: bug fixes Amit Kumar Salecha
2010-06-14 9:39 ` [PATCH 1/3] netxen: fix memory leaks in error path Amit Kumar Salecha
@ 2010-06-14 9:39 ` Amit Kumar Salecha
2010-06-14 9:39 ` [PATCH 3/3] netxen: fix caching window register Amit Kumar Salecha
2010-06-16 1:15 ` [PATCH 0/3]netxen: bug fixes David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Amit Kumar Salecha @ 2010-06-14 9:39 UTC (permalink / raw)
To: davem; +Cc: netdev, ameen.rahman
Rcv producer should be read in spin-lock.
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
drivers/net/netxen/netxen_nic_init.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index e08527f..c865dda 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -1805,9 +1805,10 @@ netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ringid,
netxen_ctx_msg msg = 0;
struct list_head *head;
+ spin_lock(&rds_ring->lock);
+
producer = rds_ring->producer;
- spin_lock(&rds_ring->lock);
head = &rds_ring->free_list;
while (!list_empty(head)) {
@@ -1829,7 +1830,6 @@ netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ringid,
producer = get_next_index(producer, rds_ring->num_desc);
}
- spin_unlock(&rds_ring->lock);
if (count) {
rds_ring->producer = producer;
@@ -1853,6 +1853,8 @@ netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ringid,
NETXEN_RCV_PRODUCER_OFFSET), msg);
}
}
+
+ spin_unlock(&rds_ring->lock);
}
static void
@@ -1864,10 +1866,11 @@ netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter,
int producer, count = 0;
struct list_head *head;
- producer = rds_ring->producer;
if (!spin_trylock(&rds_ring->lock))
return;
+ producer = rds_ring->producer;
+
head = &rds_ring->free_list;
while (!list_empty(head)) {
--
1.6.0.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] netxen: fix caching window register
2010-06-14 9:39 [PATCH 0/3]netxen: bug fixes Amit Kumar Salecha
2010-06-14 9:39 ` [PATCH 1/3] netxen: fix memory leaks in error path Amit Kumar Salecha
2010-06-14 9:39 ` [PATCH 2/3] netxen: fix rcv buffer leak Amit Kumar Salecha
@ 2010-06-14 9:39 ` Amit Kumar Salecha
2010-06-16 1:15 ` [PATCH 0/3]netxen: bug fixes David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Amit Kumar Salecha @ 2010-06-14 9:39 UTC (permalink / raw)
To: davem; +Cc: netdev, ameen.rahman
CRB window register is not per pci-func for NX3031,
so caching can result in incorrect values.
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
drivers/net/netxen/netxen_nic_hw.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index 5c496f8..29d7b93 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -1159,9 +1159,6 @@ netxen_nic_pci_set_crbwindow_2M(struct netxen_adapter *adapter, ulong off)
window = CRB_HI(off);
- if (adapter->ahw.crb_win == window)
- return;
-
writel(window, addr);
if (readl(addr) != window) {
if (printk_ratelimit())
@@ -1169,7 +1166,6 @@ netxen_nic_pci_set_crbwindow_2M(struct netxen_adapter *adapter, ulong off)
"failed to set CRB window to %d off 0x%lx\n",
window, off);
}
- adapter->ahw.crb_win = window;
}
static void __iomem *
--
1.6.0.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3]netxen: bug fixes
2010-06-14 9:39 [PATCH 0/3]netxen: bug fixes Amit Kumar Salecha
` (2 preceding siblings ...)
2010-06-14 9:39 ` [PATCH 3/3] netxen: fix caching window register Amit Kumar Salecha
@ 2010-06-16 1:15 ` David Miller
3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2010-06-16 1:15 UTC (permalink / raw)
To: amit.salecha; +Cc: netdev, ameen.rahman
From: Amit Kumar Salecha <amit.salecha@qlogic.com>
Date: Mon, 14 Jun 2010 02:39:02 -0700
> Sending series of 3 bug fixes. Please apply them on net-2.6.
All applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-06-16 1:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-14 9:39 [PATCH 0/3]netxen: bug fixes Amit Kumar Salecha
2010-06-14 9:39 ` [PATCH 1/3] netxen: fix memory leaks in error path Amit Kumar Salecha
2010-06-14 9:39 ` [PATCH 2/3] netxen: fix rcv buffer leak Amit Kumar Salecha
2010-06-14 9:39 ` [PATCH 3/3] netxen: fix caching window register Amit Kumar Salecha
2010-06-16 1:15 ` [PATCH 0/3]netxen: bug fixes 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).