From patchwork Thu Dec 3 21:06:42 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ha, Tristram" X-Patchwork-Id: 40246 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 4B751B7BC6 for ; Fri, 4 Dec 2009 08:14:50 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755452AbZLCVON (ORCPT ); Thu, 3 Dec 2009 16:14:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755076AbZLCVON (ORCPT ); Thu, 3 Dec 2009 16:14:13 -0500 Received: from p01c11o145.mxlogic.net ([208.65.144.68]:42586 "EHLO p01c11o145.mxlogic.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754325AbZLCVOM convert rfc822-to-8bit (ORCPT ); Thu, 3 Dec 2009 16:14:12 -0500 X-Greylist: delayed 455 seconds by postgrey-1.27 at vger.kernel.org; Thu, 03 Dec 2009 16:14:12 EST Received: from unknown [65.218.208.2] (EHLO p01c11o145.mxlogic.net) by p01c11o145.mxlogic.net(mxl_mta-6.4.0-2) with ESMTP id b2a281b4.cf8e3b90.19721.00-461.44857.p01c11o145.mxlogic.net (envelope-from ); Thu, 03 Dec 2009 14:14:19 -0700 (MST) X-MXL-Hash: 4b182a2b077dcd85-c7f1ebf5e1638b2e9ff7262e62e4a4411f216dc1 Received: from unknown [65.218.208.2] (EHLO Peridot.micrel.com) by p01c11o145.mxlogic.net(mxl_mta-6.4.0-2) with ESMTP id 268281b4.0.18615.00-018.42469.p01c11o145.mxlogic.net (envelope-from ); Thu, 03 Dec 2009 14:06:43 -0700 (MST) X-MXL-Hash: 4b182863120a2827-33468ed6308b35d5af14ac6496797f73ec0328cc Received: from MORGANITE.micrel.com ([10.25.1.82]) by Peridot.micrel.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 3 Dec 2009 13:06:42 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: [PATCH 2.6.32 1/3] net: Fix ks8851 snl NULL pointer dereference Oops Date: Thu, 3 Dec 2009 13:06:42 -0800 Message-ID: <14385191E87B904DBD836449AA30269D021A40@MORGANITE.micrel.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH 2.6.32 1/3] net: Fix ks8851 snl NULL pointer dereference Oops Thread-Index: Acp0Wt/33R+JFyxWRIyhBiO9ChRRhg== From: "Ha, Tristram" To: "Ben Dooks" Cc: , X-OriginalArrivalTime: 03 Dec 2009 21:06:42.0372 (UTC) FILETIME=[8364E040:01CA745C] X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2009113001)] X-MAIL-FROM: X-SOURCE-IP: [65.218.208.2] X-AnalysisOut: [v=1.0 c=1 a=8n3w4sfrkw4A:10 a=J3BOMSfJb05aRia9DmE+FQ==:17 ] X-AnalysisOut: [a=Q4n7fi2PAAAA:8 a=5_BfxKqGAAAA:8 a=4Oy_iV3DYWQYelAV22AA:9] X-AnalysisOut: [ a=OXyDB8_uO0K8Uhx2X-EA:7 a=6ITZgDGDxAxIpFPvw-UIgsrz0kwA:4] X-AnalysisOut: [ a=yJsD6ztlz_8A:10] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Tristram Ha This fixes the NULL pointer dereference Oops in the ks8851 snl network driver during transmission. All socket buffers from the queue are processed inside the loop, but new workqueues have been scheduled to run. Signed-off-by: Tristram Ha --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -urpN linux-2.6.32.old/drivers/net/ks8851.c linux-2.6.32.new/drivers/net/ks8851.c --- linux-2.6.32.old/drivers/net/ks8851.c 2009-11-03 11:37:49.000000000 -0800 +++ linux-2.6.32.new/drivers/net/ks8851.c 2009-12-02 15:31:39.000000000 -0800 @@ -1,4 +1,4 @@ -/* drivers/net/ks8651.c +/* drivers/net/ks8851.c * * Copyright 2009 Simtec Electronics * http://www.simtec.co.uk/ @@ -714,7 +714,7 @@ static void ks8851_tx_work(struct work_s { struct ks8851_net *ks = container_of(work, struct ks8851_net, tx_work); struct sk_buff *txb; - bool last = false; + bool last = skb_queue_empty(&ks->txq); mutex_lock(&ks->lock);