Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752088AbcLGFC0 (ORCPT ); Wed, 7 Dec 2016 00:02:26 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:33310 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750982AbcLGFCY (ORCPT ); Wed, 7 Dec 2016 00:02:24 -0500 MIME-Version: 1.0 In-Reply-To: <1481008233-16777-1-git-send-email-zhouzhouyi@gmail.com> References: <1481008233-16777-1-git-send-email-zhouzhouyi@gmail.com> From: Cong Wang Date: Tue, 6 Dec 2016 21:02:02 -0800 Message-ID: Subject: Re: [PATCH] net: return value of skb_linearize should be handled in Linux kernel To: Zhouyi Zhou Cc: faisal.latif@intel.com, dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com, Jeff Kirsher , QLogic-Storage-Upstream@qlogic.com, jejb@linux.vnet.ibm.com, "Martin K. Petersen" , jth@kernel.org, jon.maloy@ericsson.com, ying.xue@windriver.com, David Miller , linux-rdma@vger.kernel.org, LKML , intel-wired-lan , Linux Kernel Network Developers , linux-scsi@vger.kernel.org, fcoe-devel@open-fcoe.org, tipc-discussion@lists.sourceforge.net Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1696 Lines: 41 On Mon, Dec 5, 2016 at 11:10 PM, Zhouyi Zhou wrote: > diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c > index 2a653ec..ab787cb 100644 > --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c > +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c > @@ -490,7 +490,11 @@ int ixgbe_fcoe_ddp(struct ixgbe_adapter *adapter, > */ > if ((fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA) && > (fctl & FC_FC_END_SEQ)) { > - skb_linearize(skb); > + int err = 0; > + > + err = skb_linearize(skb); > + if (err) > + return err; You can reuse 'rc' instead of adding 'err'. > crc = (struct fcoe_crc_eof *)skb_put(skb, sizeof(*crc)); > crc->fcoe_eof = FC_EOF_T; > } > diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c > index fee1f29..4926d48 100644 > --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c > +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c > @@ -2173,8 +2173,7 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, > total_rx_bytes += ddp_bytes; > total_rx_packets += DIV_ROUND_UP(ddp_bytes, > mss); > - } > - if (!ddp_bytes) { > + } else { > dev_kfree_skb_any(skb); > continue; > } This piece doesn't seem to be related.