* [PATCH net 0/3] CAIF Bug-fixes.
@ 2012-04-12 18:18 Sjur Brændeland
2012-04-12 18:18 ` [PATCH net 1/3] caif: Fix memory leakage in the chnl_net.c Sjur Brændeland
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Sjur Brændeland @ 2012-04-12 18:18 UTC (permalink / raw)
To: netdev, davem; +Cc: sjurbren
Some simple bug fixes: plugging memory leaks and fixing the
log-level from err to dbg. I suppose these should go into v3.4.
Regards,
Sjur
--
Kim Lilliestierna (1):
caif_hsi: use dev_dbg not dev_err for reporting
Sjur Brændeland (1):
caif-hsi: Free flip_buffer at shutdown
Tomasz Gregorek (1):
caif: Fix memory leakage in the chnl_net.c.
drivers/net/caif/caif_hsi.c | 9 +++++----
net/caif/chnl_net.c | 9 ++++++---
2 files changed, 11 insertions(+), 7 deletions(-)
--
1.7.5.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net 1/3] caif: Fix memory leakage in the chnl_net.c.
2012-04-12 18:18 [PATCH net 0/3] CAIF Bug-fixes Sjur Brændeland
@ 2012-04-12 18:18 ` Sjur Brændeland
2012-04-12 18:18 ` [PATCH net 2/3] caif-hsi: Free flip_buffer at shutdown Sjur Brændeland
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Sjur Brændeland @ 2012-04-12 18:18 UTC (permalink / raw)
To: netdev, davem; +Cc: sjurbren
From: Tomasz Gregorek <tomasz.gregorek@stericsson.com>
Added kfree_skb() calls in the chnk_net.c file on
the error paths.
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
---
net/caif/chnl_net.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/net/caif/chnl_net.c b/net/caif/chnl_net.c
index 93e9c6d..69771c0 100644
--- a/net/caif/chnl_net.c
+++ b/net/caif/chnl_net.c
@@ -103,6 +103,7 @@ static int chnl_recv_cb(struct cflayer *layr, struct cfpkt *pkt)
skb->protocol = htons(ETH_P_IPV6);
break;
default:
+ kfree_skb(skb);
priv->netdev->stats.rx_errors++;
return -EINVAL;
}
@@ -220,14 +221,16 @@ static int chnl_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (skb->len > priv->netdev->mtu) {
pr_warn("Size of skb exceeded MTU\n");
+ kfree_skb(skb);
dev->stats.tx_errors++;
- return -ENOSPC;
+ return NETDEV_TX_OK;
}
if (!priv->flowenabled) {
pr_debug("dropping packets flow off\n");
+ kfree_skb(skb);
dev->stats.tx_dropped++;
- return NETDEV_TX_BUSY;
+ return NETDEV_TX_OK;
}
if (priv->conn_req.protocol == CAIFPROTO_DATAGRAM_LOOP)
@@ -242,7 +245,7 @@ static int chnl_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
result = priv->chnl.dn->transmit(priv->chnl.dn, pkt);
if (result) {
dev->stats.tx_dropped++;
- return result;
+ return NETDEV_TX_OK;
}
/* Update statistics. */
--
1.7.5.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net 2/3] caif-hsi: Free flip_buffer at shutdown
2012-04-12 18:18 [PATCH net 0/3] CAIF Bug-fixes Sjur Brændeland
2012-04-12 18:18 ` [PATCH net 1/3] caif: Fix memory leakage in the chnl_net.c Sjur Brændeland
@ 2012-04-12 18:18 ` Sjur Brændeland
2012-04-12 18:18 ` [PATCH net 3/3] caif_hsi: use dev_dbg not dev_err for reporting Sjur Brændeland
2012-04-13 15:07 ` [PATCH net 0/3] CAIF Bug-fixes David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Sjur Brændeland @ 2012-04-12 18:18 UTC (permalink / raw)
To: netdev, davem; +Cc: sjurbren
Fix memory leak of RX flip-buffer.
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
---
drivers/net/caif/caif_hsi.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c
index 9a66e2a..d0d9a6f 100644
--- a/drivers/net/caif/caif_hsi.c
+++ b/drivers/net/caif/caif_hsi.c
@@ -1210,7 +1210,7 @@ int cfhsi_probe(struct platform_device *pdev)
static void cfhsi_shutdown(struct cfhsi *cfhsi)
{
- u8 *tx_buf, *rx_buf;
+ u8 *tx_buf, *rx_buf, *flip_buf;
/* Stop TXing */
netif_tx_stop_all_queues(cfhsi->ndev);
@@ -1234,7 +1234,7 @@ static void cfhsi_shutdown(struct cfhsi *cfhsi)
/* Store bufferes: will be freed later. */
tx_buf = cfhsi->tx_buf;
rx_buf = cfhsi->rx_buf;
-
+ flip_buf = cfhsi->rx_flip_buf;
/* Flush transmit queues. */
cfhsi_abort_tx(cfhsi);
@@ -1247,6 +1247,7 @@ static void cfhsi_shutdown(struct cfhsi *cfhsi)
/* Free buffers. */
kfree(tx_buf);
kfree(rx_buf);
+ kfree(flip_buf);
}
int cfhsi_remove(struct platform_device *pdev)
--
1.7.5.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net 3/3] caif_hsi: use dev_dbg not dev_err for reporting
2012-04-12 18:18 [PATCH net 0/3] CAIF Bug-fixes Sjur Brændeland
2012-04-12 18:18 ` [PATCH net 1/3] caif: Fix memory leakage in the chnl_net.c Sjur Brændeland
2012-04-12 18:18 ` [PATCH net 2/3] caif-hsi: Free flip_buffer at shutdown Sjur Brændeland
@ 2012-04-12 18:18 ` Sjur Brændeland
2012-04-13 15:07 ` [PATCH net 0/3] CAIF Bug-fixes David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Sjur Brændeland @ 2012-04-12 18:18 UTC (permalink / raw)
To: netdev, davem; +Cc: sjurbren
From: Kim Lilliestierna XX <kim.xx.lilliestierna@stericsson.com>
Use dev_dbg instead of dev_err for reporting in cfhsi_wakeup_cb.
Signed-off-by: Kim Lilliestierna <kim.xx.lilliestierna@stericsson.com>
---
drivers/net/caif/caif_hsi.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c
index d0d9a6f..9c1c8cd 100644
--- a/drivers/net/caif/caif_hsi.c
+++ b/drivers/net/caif/caif_hsi.c
@@ -744,14 +744,14 @@ static void cfhsi_wake_up(struct work_struct *work)
size_t fifo_occupancy = 0;
/* Wakeup timeout */
- dev_err(&cfhsi->ndev->dev, "%s: Timeout.\n",
+ dev_dbg(&cfhsi->ndev->dev, "%s: Timeout.\n",
__func__);
/* Check FIFO to check if modem has sent something. */
WARN_ON(cfhsi->dev->cfhsi_fifo_occupancy(cfhsi->dev,
&fifo_occupancy));
- dev_err(&cfhsi->ndev->dev, "%s: Bytes in FIFO: %u.\n",
+ dev_dbg(&cfhsi->ndev->dev, "%s: Bytes in FIFO: %u.\n",
__func__, (unsigned) fifo_occupancy);
/* Check if we misssed the interrupt. */
--
1.7.5.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net 0/3] CAIF Bug-fixes.
2012-04-12 18:18 [PATCH net 0/3] CAIF Bug-fixes Sjur Brændeland
` (2 preceding siblings ...)
2012-04-12 18:18 ` [PATCH net 3/3] caif_hsi: use dev_dbg not dev_err for reporting Sjur Brændeland
@ 2012-04-13 15:07 ` David Miller
3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2012-04-13 15:07 UTC (permalink / raw)
To: sjur.brandeland; +Cc: netdev, sjurbren
From: Sjur Brændeland <sjur.brandeland@stericsson.com>
Date: Thu, 12 Apr 2012 20:18:06 +0200
> Some simple bug fixes: plugging memory leaks and fixing the
> log-level from err to dbg. I suppose these should go into v3.4.
All applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-04-13 15:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-12 18:18 [PATCH net 0/3] CAIF Bug-fixes Sjur Brændeland
2012-04-12 18:18 ` [PATCH net 1/3] caif: Fix memory leakage in the chnl_net.c Sjur Brændeland
2012-04-12 18:18 ` [PATCH net 2/3] caif-hsi: Free flip_buffer at shutdown Sjur Brændeland
2012-04-12 18:18 ` [PATCH net 3/3] caif_hsi: use dev_dbg not dev_err for reporting Sjur Brændeland
2012-04-13 15:07 ` [PATCH net 0/3] CAIF Bug-fixes David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.