diff --git a/drivers/android/binder/thread.rs b/drivers/android/binder/thread.rs index e5ae3b0e56c5..5bb7ae2f7920 100644 --- a/drivers/android/binder/thread.rs +++ b/drivers/android/binder/thread.rs @@ -1333,8 +1333,8 @@ fn transaction(self: &Arc, cmd: u32, reader: &mut UserSliceReader) -> Resu if err.reply != BR_TRANSACTION_COMPLETE { info.reply = err.reply; info.error_line = Some(err.line); - if let Some(source) = &err.source { - info.errno = source.to_errno(); + if let Some(source) = err.source { + info.errno = Some(source); { let mut inner = self.inner.lock(); @@ -1476,7 +1476,7 @@ fn reply_inner(self: &Arc, info: &mut TransactionInfo) -> BinderResult { orig.from .deliver_reply(Err(BR_FAILED_REPLY), &orig, Some(ee)); info.reply = BR_FAILED_REPLY; - info.errno = param; + info.errno = err.source; info.error_line = Some(err.line); err.reply = BR_TRANSACTION_COMPLETE; err diff --git a/drivers/android/binder/transaction.rs b/drivers/android/binder/transaction.rs index e627522141b8..d934c6821b15 100644 --- a/drivers/android/binder/transaction.rs +++ b/drivers/android/binder/transaction.rs @@ -136,7 +136,11 @@ fn new(info: &TransactionInfo, ctx: &crate::Context) -> Self { offsets_size: info.offsets_size, return_error_line: if failed { info.error_line } else { None }, return_error: if failed { info.reply } else { 0 }, - return_error_param: if failed { info.errno } else { 0 }, + return_error_param: if failed { + info.errno.map_or(0, |e| e.to_errno()) + } else { + 0 + }, context_name, } } @@ -254,7 +258,7 @@ pub(crate) struct TransactionInfo { pub(crate) offsets_size: usize, pub(crate) buffers_size: usize, pub(crate) target_handle: u32, - pub(crate) errno: i32, + pub(crate) errno: Option, pub(crate) reply: u32, pub(crate) error_line: Option, pub(crate) oneway_spam_suspect: bool,