device alloc ret fix