Hi Alex,
On 07/24/2014 05:40 PM, Alexander Aring wrote:
> Varka,
>
> On Thu, Jul 24, 2014 at 05:16:39PM +0530, [email protected] wrote:
>> From: Varka Bhadram <[email protected]>
>>
>> This patch replace the kfree(skb) with dev_kfree_skb() which is
> s/kfree(skb)/kfree_skb(skb)
>
>> used on tx error path. And also use sizeof(*work) instead of
>> sizeof(struct xmit_work)
>>
>> Signed-off-by: Varka Bhadram <[email protected]>
>> ---
>> net/mac802154/tx.c | 9 ++++-----
>> 1 file changed, 4 insertions(+), 5 deletions(-)
>>
>> diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
>> index 8124353..d05d6ea 100644
>> --- a/net/mac802154/tx.c
>> +++ b/net/mac802154/tx.c
>> @@ -89,7 +89,7 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv,
>> struct sk_buff *skb,
>>
>> if (!(priv->phy->channels_supported[page] & (1 << chan))) {
>> WARN_ON(1);
>> - kfree_skb(skb);
>> + dev_kfree_skb(skb);
>> return NETDEV_TX_OK;
>> }
>>
>> @@ -104,13 +104,13 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv,
>> struct sk_buff *skb,
>> }
>>
>> if (skb_cow_head(skb, priv->hw.extra_tx_headroom)) {
>> - kfree_skb(skb);
>> + dev_kfree_skb(skb);
Is it acceptable here..?
>> return NETDEV_TX_OK;
>> }
>>
>> - work = kzalloc(sizeof(struct xmit_work), GFP_ATOMIC);
>> + work = kzalloc(sizeof(*work), GFP_ATOMIC);
>> if (!work) {
>> - kfree_skb(skb);
>> + dev_kfree_skb(skb);
>> return NETDEV_TX_BUSY;
>> }
> Sorry this is wrong. dev_kfree_skb is the same like consume_skb.
>
> Look for the documentation:
>
> "Drop a ref to the buffer and free it if the usage count has hit zero
> Functions identically to kfree_skb, but kfree_skb assumes that the frame
> is being dropped after a failure and notes that"
This type of functionality use on IEEE-80211 subsystem also.. Every where on Tx
error path subsystem uses dev_kfree_skb(skb);
>>
>> @@ -127,6 +127,5 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv,
>> struct sk_buff *skb,
>> work->chan = chan;
>>
>> queue_work(priv->dev_workqueue, &work->work);
>> -
> we don't need to change that.
Ok..
--
Regards,
Varka Bhadram.
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Linux-zigbee-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel