Received: with ECARTIS (v1.0.0; list netdev); Wed, 20 Jul 2005 00:21:37 -0700 (PDT) Received: from sunsite.mff.cuni.cz (sunsite.ms.mff.cuni.cz [195.113.15.26]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id j6K7LPH9021647 for ; Wed, 20 Jul 2005 00:21:26 -0700 Received: from sunsite.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.1/8.13.1) with ESMTP id j6K7JLtE026511; Wed, 20 Jul 2005 09:19:21 +0200 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.13.1/8.13.1/Submit) id j6K7JKaV026498; Wed, 20 Jul 2005 09:19:20 +0200 Date: Wed, 20 Jul 2005 09:19:20 +0200 From: Jakub Jelinek To: chas williams - CONTRACTOR Cc: netdev@oss.sgi.com, davem@davemloft.net Subject: Re: [PATCH 1/8][ATM]: [zatm] eliminate kfree warning (from Tobias Hirning ) Message-ID: <20050720071919.GV4740@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek References: <200507192044.j6JKirFb027183@ginger.cmf.nrl.navy.mil> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200507192044.j6JKirFb027183@ginger.cmf.nrl.navy.mil> User-Agent: Mutt/1.4.1i X-archive-position: 2760 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jakub@redhat.com Precedence: bulk X-list: netdev Content-Length: 1720 Lines: 44 On Tue, Jul 19, 2005 at 04:44:54PM -0400, chas williams - CONTRACTOR wrote: > please apply to 2.6 -- thanks! > > [ATM]: [zatm] eliminate kfree warning (from Tobias Hirning ) > > Signed-off-by: Chas Williams > > > --- > commit 4932248439d20412610ffaade625cbde0e001e37 > tree 35a60e3551f5f1abced8a435238575c488041af6 > parent 238921d2cb04eb6dcc2ff5914d555d7dcaa4dfc5 > author chas williams Wed, 06 Jul 2005 13:10:18 -0400 > committer chas williams Wed, 06 Jul 2005 13:10:18 -0400 > > drivers/atm/zatm.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c > --- a/drivers/atm/zatm.c > +++ b/drivers/atm/zatm.c > @@ -1339,7 +1339,7 @@ static int __init zatm_start(struct atm_ > return 0; > out: > for (i = 0; i < NR_MBX; i++) > - kfree(zatm_dev->mbx_start[i]); > + kfree(&zatm_dev->mbx_start[i]); This can't be right. zatm_dev->mbx_start[i] is allocated with: 1306 here = (unsigned long) kmalloc(2*MBX_SIZE(i), 1307 GFP_KERNEL); 1308 if (!here) { 1309 error = -ENOMEM; 1310 goto out; 1311 } 1312 if ((here^(here+MBX_SIZE(i))) & ~0xffffUL)/* paranoia */ 1313 here = (here & ~0xffffUL)+0x10000; 1314 zatm_dev->mbx_start[i] = here; so even kfree((void *)zatm_dev->mbx_start[i]); is wrong in case there was an alignment, but kfree(&zatm_dev->mbx_start[i]) is wrong in all cases. Jakub