[PATCH 1/5] mtd: m25p80: fix allocation size
Marek Vasut
marex at denx.de
Mon Oct 28 00:54:15 PDT 2013
Hi Brian,
> On Sun, Oct 27, 2013 at 9:30 AM, Marek Vasut <marex at denx.de> wrote:
> > Hi Brian,
> >
> > [...]
> >
> >> @@ -1137,14 +1135,10 @@ static int m25p_probe(struct spi_device *spi)
> >>
> >> static int m25p_remove(struct spi_device *spi)
> >> {
> >>
> >> struct m25p *flash = spi_get_drvdata(spi);
> >>
> >> - int status;
> >>
> >> /* Clean up MTD stuff. */
> >>
> >> - status = mtd_device_unregister(&flash->mtd);
> >> - if (status == 0) {
> >> - kfree(flash->command);
> >> - kfree(flash);
> >> - }
> >> + mtd_device_unregister(&flash->mtd);
> >> +
> >>
> >> return 0;
> >>
> >> }
> >
> > I wonder if we shouldn't return "status" in here in case
> > mtd_device_unregister() failed.
>
> Sure, I thought of that earlier actually. I may send a trivial
> follow-up patch for this.
Sounds good, certainly better than mixing two things into one patch. Thanks!
Best regards,
Marek Vasut
More information about the linux-mtd
mailing list