[PATCH 2/2] drivers/mtd/maps/pcmciamtd.c: coding style cleanups

Dominik Brodowski linux at dominikbrodowski.net
Thu Apr 15 13:27:50 EDT 2010


Alexander,

On Mon, Apr 12, 2010 at 07:51:12PM +0400, Alexander Kurz wrote:
> @@ -691,7 +701,8 @@ static void pcmciamtd_detach(struct pcmcia_device *link)
>  	if(dev->mtd_info) {
>  		del_mtd_device(dev->mtd_info);
>  		map_destroy(dev->mtd_info);
> -		info("mtd%d: Removed", dev->mtd_info->index);
> +		dev_info(&dev->p_dev->dev, "mtd%d: Removed\n",
> +			 dev->mtd_info->index);
>  	}

Could you switch the ordering between map_destroy() and dev_info(), please,
to avoid an use-after-free? See the attached message by Julia Lawall, who
noted this issue first.

Best,
	Dominik
-------------- next part --------------
An embedded message was scrubbed...
From: Julia Lawall <julia at diku.dk>
Subject: [PATCH 2/3] drivers/mtd/maps: Eliminate use after free
Date: Fri, 2 Apr 2010 14:47:38 +0200 (CEST)
Size: 3561
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20100415/5b4cb215/attachment.mail>


More information about the linux-mtd mailing list