SIGN IN SIGN UP

ROCM-23527 - hipMemRetainAllocationHandle should return error

for non VMM allocations (#5807)

## Motivation

hipMemRetainAllocationHandle API was crashing when hipMalloc'd pointers
are passed. It should return error gracefully instead.

## Technical Details

For Non VMM allocations, the physical mem obj doesn't exist for the
pointers, and hence hipMemRetainAllocationHandle API should check the
phys_mem_obj instead of directly dereferencing it.

## JIRA ID

ROCM-23527

## Test Plan

Verified with the given reproducer.

## Test Result

PASS

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
[rocm-systems] ROCm/rocm-systems#5807 (commit 6693769)
S
Satyanvesh Dittakavi committed
ebd359cf4821ec57665edbbf752cd98f3af1e58b
Parent: a1dcede
Committed by systems-assistant[bot] <systems-assistant[bot]@users.noreply.github.com> on 5/15/2026, 6:57:05 PM