RE: [PATCH v3 1/2] PRUSS UIO driver support

From: TK, Pratheesh Gangadhar
Date: Thu Feb 24 2011 - 08:55:32 EST



> -----Original Message-----
> From: Thomas Gleixner [mailto:tglx@xxxxxxxxxxxxx]
> Sent: Thursday, February 24, 2011 1:56 AM
> To: TK, Pratheesh Gangadhar
> Cc: davinci-linux-open-source@xxxxxxxxxxxxxxxxxxxx; hjk@xxxxxxxxxxxx;
> gregkh@xxxxxxx; Chatterjee, Amit; linux-kernel@xxxxxxxxxxxxxxx; linux-arm-
> kernel@xxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v3 1/2] PRUSS UIO driver support
>
> On Wed, 23 Feb 2011, Pratheesh Gangadhar wrote:
>
> Is it actually too much of an hassle to cc the people who spent their
> time to review previous versions of your patch ?
>
Sorry. Will do...
> > +struct clk *pruss_clk;
> > +struct uio_info *info;
> > +void *ddr_virt_addr = NULL, *prussio_virt_addr = NULL;
>
> Grrr. We do not initialize with NULL.
>
> > +dma_addr_t ddr_phy_addr;
>
> Also all of these want to be static.
>
Ok.
>
> > + uio_unregister_device(p);
> > + kfree(p->name);
> > + }
> > + iounmap(prussio_virt_addr);
> > + dma_free_coherent(&dev->dev, info[0].mem[2].size,
> > + info[0].mem[2].internal_addr, info[0].mem[2].addr);
>
> You sure, that iounmap and dma_free_coherent are too happy about being
> called with NULL pointers?
>
For iounmap its ok, not ok for dma_free_coherent. Will fix.
> > +
> > + kfree(info);
> > + clk_put(pruss_clk);
> > +}
> > +
> > +static int __devinit pruss_probe(struct platform_device *dev)
> > +{
> > + int ret = -ENODEV, count = 0;
> > + struct resource *regs_prussio, *regs_l3ram, *regs_ddr;
> > + struct uio_info *p;
> > +
> > + info = kzalloc(sizeof(struct uio_info) * MAX_PRUSS_EVTOUT_INSTANCE,
> > + GFP_KERNEL);
> > + if (!info)
> > + return -ENOMEM;
> > +
> > + /* Power on PRU in case its not done as part of boot-loader */
> > + pruss_clk = clk_get(&dev->dev, "pruss");
> > + if (IS_ERR(pruss_clk)) {
> > + dev_err(&dev->dev, "Failed to get clock\n");
> > + ret = PTR_ERR(pruss_clk);
> > + return ret;
>
> Memory leak.
Will fix.


Thanks,
Pratheesh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/