Re: [PATCH 1/1] Char: correct pci_get_device changes

From: Greg KH
Date: Sun Oct 15 2006 - 00:22:55 EST


On Sun, Oct 15, 2006 at 01:36:45AM +0200, Jiri Slaby wrote:
> correct pci_get_device changes
>
> Commits 881a8c120acf7ec09c90289e2996b7c70f51e996 and
> efe1ec27837d6639eae82e1f5876910ba6433c3f are totally wrong and
> "Replace pci_find_device() with more safer pci_get_device()." holds only for a
> very short time until next iteration of pci_get_device is called (and
> refcount is decreased again there).
>
> Whenever pci_find_device -> pci_get_device change is performed, also
> pci_dev_get and pci_dev_put should be in most cases called. If not, it's
> not easy to find such issues and this is example of such case. Here it
> was made safer in no way but a moment during initialization, weird.
>
> It affects moxa and rio char drivers. (All this stuff deserves to be
> converted to pci_probing, though.)
>
> Cc: <R.E.Wolff@xxxxxxxxxxxx>
> Cc: Amit Gud <gud@xxxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxx>
> Signed-off-by: Jiri Slaby <jirislaby@xxxxxxxxx>

Acked-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

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