diff options
author | Liu Gang <[email protected]> | 2011-11-02 13:39:07 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2011-11-02 16:07:01 -0700 |
commit | e80dd9a7bca4057d5a09d1ba94a7ba0791e7426a (patch) | |
tree | b2be7b812974cdcc769df2480f2484d887092b31 /tools/perf/scripts/python/check-perf-trace.py | |
parent | a571259f4874023306db36e83054d093833b1902 (diff) |
arch/powerpc/sysdev/fsl_rio.c: release rapidio port I/O region resource if port failed to initialize
The "struct rio_mport" contains a member of master port I/O memory
resource structure "struct resource iores". This resource will be read
from device tree and be used for rapidio R/W transaction memory space.
Rapidio requests the port I/O memory resource under the root resource
"iomem_resource".
struct rio_mport *port;
port = kzalloc(sizeof(struct rio_mport), GFP_KERNEL);
request_resource(&iomem_resource, &port->iores);
When port failed to initialize, allocated "rio_mport" structure memory
will be freed, and the port I/O memory resource structure pointer
"&port->iores" will be invalid. If other requests resource under
"iomem_resource", "&port->iores" node may be operated in the child
resources list and this will cause the system to crash.
So the requested port I/O memory resource should be released before
freeing allocated "rio_mport" structure.
Signed-off-by: Liu Gang <[email protected]>
Acked-by: Alexandre Bounine <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Grant Likely <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/check-perf-trace.py')
0 files changed, 0 insertions, 0 deletions