Re: [PATCH 088/117] Staging: hv: netvsc: Inline the code forfree_net_device()

From: Dan Carpenter
Date: Sat Jul 16 2011 - 06:35:39 EST


On Fri, Jul 15, 2011 at 10:47:16AM -0700, K. Y. Srinivasan wrote:
> -static void free_net_device(struct netvsc_device *device)
> -{
> - WARN_ON(atomic_read(&device->refcnt) != 0);
> - device->dev->ext = NULL;

device->dev->ext points to device. We set it NULL here to prevent
a use after free bug. What prevents that in the new code?

> - kfree(device);
> -}

regards,
dan carpenter


--
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/