Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753418AbbHNX2j (ORCPT ); Fri, 14 Aug 2015 19:28:39 -0400 Received: from mga01.intel.com ([192.55.52.88]:47351 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752000AbbHNX2i convert rfc822-to-8bit (ORCPT ); Fri, 14 Aug 2015 19:28:38 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,680,1432623600"; d="scan'208";a="748899986" From: "Brown, Aaron F" To: Jia-Ju Bai , "Kirsher, Jeffrey T" , "Brandeburg, Jesse" CC: "netdev@vger.kernel.org" , "intel-wired-lan@lists.osuosl.org" , "linux-kernel@vger.kernel.org" Subject: RE: [Intel-wired-lan] [PATCH v2] e1000e: Modify tx/rx configurations to avoid null pointer dereferences in e1000_open Thread-Topic: [Intel-wired-lan] [PATCH v2] e1000e: Modify tx/rx configurations to avoid null pointer dereferences in e1000_open Thread-Index: AQHQz2fd7tswYe6eqUylezr4uCYhnp4MMuGg Date: Fri, 14 Aug 2015 23:28:36 +0000 Message-ID: <309B89C4C689E141A5FF6A0C5FB2118B81AE74F9@ORSMSX101.amr.corp.intel.com> References: <1438769770-8887-1-git-send-email-baijiaju1990@163.com> In-Reply-To: <1438769770-8887-1-git-send-email-baijiaju1990@163.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.138] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1538 Lines: 34 > From: Intel-wired-lan [mailto:intel-wired-lan-bounces@lists.osuosl.org] On > Behalf Of Jia-Ju Bai > Sent: Wednesday, August 05, 2015 3:16 AM > To: Kirsher, Jeffrey T; Brandeburg, Jesse > Cc: netdev@vger.kernel.org; Jia-Ju Bai; intel-wired-lan@lists.osuosl.org; > linux-kernel@vger.kernel.org > Subject: [Intel-wired-lan] [PATCH v2] e1000e: Modify tx/rx configurations > to avoid null pointer dereferences in e1000_open > > When e1000e_setup_rx_resources is failed in e1000_open, > e1000e_free_tx_resources in "err_setup_rx" segment is executed. > "writel(0, tx_ring->head)" statement in e1000_clean_tx_ring > in e1000e_free_tx_resources will cause a null poonter dereference(crash), > because "tx_ring->head" is only assigned in e1000_configure_tx > in e1000_configure, but it is after e1000e_setup_rx_resources. > > This patch moves head/tail register writing to e1000_configure_tx/rx, > which can fix this problem. It is inspired by igb_configure_tx_ring > in the igb driver. > > Specially, thank Alexander Duyck for his valuable suggestion. > > Signed-off-by: Jia-Ju Bai > --- > drivers/net/ethernet/intel/e1000e/netdev.c | 24 ++++++++++++----------- > - > 1 file changed, 12 insertions(+), 12 deletions(-) Tested-by: Aaron Brown -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/