[core] Do device validity check at the start of try_map_async

this is important as we need to return Abort error instead of Operation error which is raised on invalid buffer

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
sagudev authored and mergify[bot] committed 2026-10-26 18:49:57 +00:00
1 parent 4e98175c04
commit 9e80fc9d1d
1 file changed
+5 -5
+5 -5
View File
@@ -831,6 +831,11 @@ impl Buffer {
self.size.saturating_sub(offset)
};
let device = &self.device;
if let Err(e) = device.check_is_valid() {
return Err((callback, e.into()));
}
if let Err(e) = self.check_is_valid() {
return Err((callback, e.into()));
}
@@ -882,11 +887,6 @@ impl Buffer {
return Err((callback, e.into()));
}
let device = &self.device;
if let Err(e) = device.check_is_valid() {
return Err((callback, e.into()));
}
let submit_index = {
let snatch_guard = device.snatchable_lock.read();
if let Err(e) = self.check_destroyed(&snatch_guard) {