[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1481093479.18162.639.camel@edumazet-glaptop3.roam.corp.google.com>
Date: Tue, 06 Dec 2016 22:51:19 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Zhouyi Zhou <zhouzhouyi@...il.com>
Cc: faisal.latif@...el.com, dledford@...hat.com, sean.hefty@...el.com,
hal.rosenstock@...il.com, jeffrey.t.kirsher@...el.com,
QLogic-Storage-Upstream@...gic.com, jejb@...ux.vnet.ibm.com,
martin.petersen@...cle.com, jth@...nel.org, jon.maloy@...csson.com,
ying.xue@...driver.com, davem@...emloft.net,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org,
linux-scsi@...r.kernel.org, fcoe-devel@...n-fcoe.org,
tipc-discussion@...ts.sourceforge.net
Subject: Re: [PATCH] net: return value of skb_linearize should be handled in
Linux kernel
On Tue, 2016-12-06 at 15:10 +0800, Zhouyi Zhou wrote:
> kmalloc_reserve may fail to allocate memory inside skb_linearize,
> which means skb_linearize's return value should not be ignored.
> Following patch correct the uses of skb_linearize.
>
> Compiled in x86_64
>
> Signed-off-by: Zhouyi Zhou <zhouzhouyi@...il.com>
> ---
> drivers/infiniband/hw/nes/nes_nic.c | 5 +++--
> drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 6 +++++-
> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 3 +--
> drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 7 +++++--
> drivers/scsi/fcoe/fcoe.c | 5 ++++-
> net/tipc/link.c | 3 ++-
> net/tipc/name_distr.c | 5 ++++-
> 7 files changed, 24 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
> index 2b27d13..69372ea 100644
> --- a/drivers/infiniband/hw/nes/nes_nic.c
> +++ b/drivers/infiniband/hw/nes/nes_nic.c
> @@ -662,10 +662,11 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
> nesnic->sq_head &= nesnic->sq_size-1;
> }
> } else {
> - nesvnic->linearized_skbs++;
> hoffset = skb_transport_header(skb) - skb->data;
> nhoffset = skb_network_header(skb) - skb->data;
> - skb_linearize(skb);
> + if (skb_linearize(skb))
> + return NETDEV_TX_BUSY;
This would live lock.
Please drop the packet.
You probably should send one patch per driver, to ease code review and
acceptance.
Powered by blists - more mailing lists