Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751261AbWEQWRP (ORCPT ); Wed, 17 May 2006 18:17:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751244AbWEQWQr (ORCPT ); Wed, 17 May 2006 18:16:47 -0400 Received: from 216-99-217-87.dsl.aracnet.com ([216.99.217.87]:6272 "EHLO sous-sol.org") by vger.kernel.org with ESMTP id S1751243AbWEQWQo (ORCPT ); Wed, 17 May 2006 18:16:44 -0400 Message-Id: <20060517221359.723871000@sous-sol.org> References: <20060517221312.227391000@sous-sol.org> Date: Wed, 17 May 2006 00:00:08 -0700 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk, Jean Delvare , Greg Kroah-Hartman Subject: [PATCH 08/22] [PATCH] scx200_acb: Fix resource name use after free Content-Disposition: inline; filename=scx200_acb-fix-resource-name-use-after-free.patch Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1609 Lines: 44 -stable review patch. If anyone has any objections, please let us know. ------------------ We can't pass a string on the stack to request_region. As soon as we leave the function that stack is gone and the string is lost. Let's use the same string we identify the i2c_adapter with instead, it's more simple, more consistent, and just works. This is the second half of fix to bug #6445. Signed-off-by: Jean Delvare Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/scx200_acb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- linux-2.6.16.16.orig/drivers/i2c/busses/scx200_acb.c +++ linux-2.6.16.16/drivers/i2c/busses/scx200_acb.c @@ -440,7 +440,6 @@ static int __init scx200_acb_create(int struct scx200_acb_iface *iface; struct i2c_adapter *adapter; int rc = 0; - char description[64]; iface = kzalloc(sizeof(*iface), GFP_KERNEL); if (!iface) { @@ -459,8 +458,7 @@ static int __init scx200_acb_create(int init_MUTEX(&iface->sem); - snprintf(description, sizeof(description), "NatSemi SCx200 ACCESS.bus [%s]", adapter->name); - if (request_region(base, 8, description) == 0) { + if (!request_region(base, 8, adapter->name)) { dev_err(&adapter->dev, "can't allocate io 0x%x-0x%x\n", base, base + 8-1); rc = -EBUSY; -- - 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/