Returns 0 on success, < 0 on error. mapping is cleared if successful. */
| 116 | |
| 117 | /* Returns 0 on success, < 0 on error. mapping is cleared if successful. */ |
| 118 | static int unmap_memory(struct mapping *mapping) |
| 119 | { |
| 120 | if (mapping->virt == NULL) |
| 121 | return -1; |
| 122 | |
| 123 | munmap(mapping->virt, mapping->virt_size); |
| 124 | mapping->virt = NULL; |
| 125 | mapping->offset = 0; |
| 126 | mapping->virt_size = 0; |
| 127 | |
| 128 | return 0; |
| 129 | } |
| 130 | |
| 131 | /* |
| 132 | * Some architectures map /dev/mem memory in a way that doesn't support |
no outgoing calls
no test coverage detected