Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S264902AbUFOA22 (ORCPT ); Mon, 14 Jun 2004 20:28:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S264900AbUFOA22 (ORCPT ); Mon, 14 Jun 2004 20:28:28 -0400 Received: from e35.co.us.ibm.com ([32.97.110.133]:53181 "EHLO e35.co.us.ibm.com") by vger.kernel.org with ESMTP id S264902AbUFOA20 (ORCPT ); Mon, 14 Jun 2004 20:28:26 -0400 Subject: [PATCH] insert_resource() nesting fix From: John Rose To: lkml , Greg KH Content-Type: text/plain Message-Id: <1087247406.11961.17.camel@sinatra.austin.ibm.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Mon, 14 Jun 2004 16:10:07 -0500 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1004 Lines: 33 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 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/