From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.176]) by ozlabs.org (Postfix) with ESMTP id 39EA5DDFA5 for ; Thu, 3 Jul 2008 01:27:14 +1000 (EST) Received: by py-out-1112.google.com with SMTP id z59so205845pyg.27 for ; Wed, 02 Jul 2008 08:27:13 -0700 (PDT) Message-ID: <486B9E53.7070606@gmail.com> Date: Wed, 02 Jul 2008 23:27:15 +0800 From: Chen Gong MIME-Version: 1.0 To: Kumar Gala Subject: Re: [PATCH] powerpc/85xx: Add support for MPC8536DS References: <20080702170814.de282293.sfr@canb.auug.org.au> <486B8AFE.7060303@gmail.com> In-Reply-To: Content-Type: text/plain; charset=GB2312 Cc: Stephen Rothwell , linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Kumar Gala дµÀ: > > On Jul 2, 2008, at 9:04 AM, Chen Gong wrote: > >> Stephen Rothwell дµÀ: >>> Hi Kumar, >>> >>> On Wed, 2 Jul 2008 02:01:10 -0500 (CDT) Kumar Gala >>> wrote: >>>> +void __init mpc8536_ds_pic_init(void) >>>> +{ >>>> + struct mpic *mpic; >>>> + struct resource r; >>>> + struct device_node *np = NULL; >>> >>> You don't need to initialise this. >>> >>>> + np = of_find_node_by_type(np, "open-pic"); >>>> + >>> >>> Extra blank line. >>> >>>> + if (np == NULL) { >>>> + printk(KERN_ERR "Could not find open-pic node\n"); >>>> + return; >>>> + } >>>> + >>>> + if (of_address_to_resource(np, 0, &r)) { >>>> + printk(KERN_ERR "Failed to map mpic register space\n"); >>>> + of_node_put(np); >>>> + return; >>>> + } >>>> + >>>> + mpic = mpic_alloc(np, r.start, >>>> + MPIC_PRIMARY | MPIC_WANTS_RESET | >>>> + MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, >>>> + 0, 256, " OpenPIC "); >>>> + BUG_ON(mpic == NULL); >>>> + >>>> + mpic_init(mpic); >>> >>> You leak a reference to np here. >> >> It looks like there are same problem in other mpc85xx_xx.c files > > agreed for the mpc85xx_ds.c, I dont see the _cds or _ads having these > issues. Yes, maybe I should write as mpc8xxx_xx.c, because it seems there is the same problem in mpc8610_hpcd.c mpc86xx_hpcn.c etc. > > - k > >