Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751347AbWJMAED (ORCPT ); Thu, 12 Oct 2006 20:04:03 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751350AbWJMAEB (ORCPT ); Thu, 12 Oct 2006 20:04:01 -0400 Received: from twin.jikos.cz ([213.151.79.26]:3549 "EHLO twin.jikos.cz") by vger.kernel.org with ESMTP id S1751347AbWJMAEA (ORCPT ); Thu, 12 Oct 2006 20:04:00 -0400 Date: Fri, 13 Oct 2006 02:03:28 +0200 (CEST) From: Jiri Kosina To: Russell King cc: Phil Blundell , Tim Waugh , Andrew Morton , linux-kernel@vger.kernel.org, linux-parport@lists.infradead.org Subject: Re: [PATCH] fix parport_serial_pci_resume() ignoring return value from pci_enable_device() In-Reply-To: <20061012235820.GC24658@flint.arm.linux.org.uk> Message-ID: References: <20061012235820.GC24658@flint.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 854 Lines: 22 On Fri, 13 Oct 2006, Russell King wrote: > In this case, you're calling parport_serial_pci_remove() in the failure > path. That's fine, but this opens the possibility of it being called > twice - once on resume failure and once when the device/driver is > removed. If this happens, we dereference a NULL pointer. *BAD*. You are right, I missed this. I am not currently sure what the proper fix is, though. We might be also ending doing very bad things, when we ignore the error returned by pci_enable_device() and proceed operating on non-existing device. Thanks for spotting this, -- Jiri Kosina - 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/