PCI: aerdrv: rework get_e_source()
authorHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Thu, 15 Apr 2010 04:16:16 +0000 (13:16 +0900)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Tue, 11 May 2010 19:01:33 +0000 (12:01 -0700)
commit88da13bfabbffb8f89574eb168b9da9a0abc693f
tree0d618bd5c2ddab8ba03d9b0c21b3998f2928d282
parent7c4ec94f72cefec1c1b42219469794a34864a1ee
PCI: aerdrv: rework get_e_source()

Current get_e_source() returns pointer to an element of array.
However since it also progress consume counter, it is possible
that the element is overwritten by newly produced data before
the element is really consumed.

This patch changes get_e_source() to copy contents of the element
to address pointed by its caller.  Once copied the element in
array can be consumed.

And relocate this function to more innocuous place.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/pcie/aer/aerdrv_core.c