m25p80: missing MTD owner

Marek Vasut marex at denx.de
Thu Oct 4 20:51:18 EDT 2012


Dear Grégor Boirie,

> Hi all,
> 
> It seems possible to unload m25p80 module while a JFFS2 partition is
> still mounted onto flash. This produces oops when MTD layer tries to
> access underlying device later on.
> 
> A quick look at m25p_probe shows that "owner" field of allocated mtd
> device structure is left uninitialized, preventing MTD layer from
> incrementing module usage count. This patch for v3.4.11 solves the issue
> for me :
> 
> @@ -873,6 +873,7 @@ static int __devinit m25p_probe(struct spi_device *spi)
>         else
>                 flash->mtd.name = dev_name(&spi->dev);
> 
> +       flash->mtd.owner = THIS_MODULE;
>         flash->mtd.type = MTD_NORFLASH;
>         flash->mtd.writesize = 1;
>         flash->mtd.flags = MTD_CAP_NORFLASH;
> 
> 
> Regards.

Do you mind submitting a proper patch via git send-email please?

Best regards,
Marek Vasut



More information about the linux-mtd mailing list