Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266851AbUFYTSv (ORCPT ); Fri, 25 Jun 2004 15:18:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266847AbUFYTSu (ORCPT ); Fri, 25 Jun 2004 15:18:50 -0400 Received: from e32.co.us.ibm.com ([32.97.110.130]:3565 "EHLO e32.co.us.ibm.com") by vger.kernel.org with ESMTP id S266852AbUFYTSP (ORCPT ); Fri, 25 Jun 2004 15:18:15 -0400 Subject: [PATCH] PCI insert_resource() nesting fix From: John Rose To: lkml Cc: torvalds@osdl.org, greg@kroah.org Content-Type: text/plain Message-Id: <1088191293.29106.13.camel@sinatra.austin.ibm.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Fri, 25 Jun 2004 14:21:33 -0500 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1056 Lines: 35 Noticed that insert_resource() incorrectly handles the case of an existing parent resource with the same ending address as a newly added child. This results in incorrect nesting, like the following: # cat /proc/ioports 002f0000-002fffff : PCI Bus #48 00200000-002fffff : /pci@800000020000003 Thanks- John Signed-off-by: John Rose diff -Nru a/kernel/resource.c b/kernel/resource.c --- a/kernel/resource.c Mon Jun 14 15:42:29 2004 +++ b/kernel/resource.c Mon Jun 14 15:42:29 2004 @@ -332,8 +332,8 @@ if (next->sibling->start > new->end) break; - /* existing resource overlaps end of new resource */ - if (next->end > new->end) { + /* existing resource includes new resource */ + if (next->end >= new->end) { parent = next; result = 0; goto begin; - 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/