diff options
author | Mario Limonciello <mario.limonciello@amd.com> | 2023-08-29 10:07:57 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2023-09-15 18:29:45 +0800 |
commit | 70f242c1933e9e881c13c31640bb6d56e8b7e738 (patch) | |
tree | 7f06c566d5ab018ed02e127f1b8d32cd8a3d5b27 /tools/crypto/ccp/dbc.py | |
parent | 7f71c3e033824e1da237916a1885e3c0699f86b2 (diff) |
crypto: ccp - Fix DBC sample application error handling
The sample application was taking values from ioctl() and treating
those as the error codes to present to a user.
This is incorrect when ret is non-zero, the error is stored to `errno`.
Use this value instead.
Fixes: f40d42f116cf ("crypto: ccp - Add a sample python script for Dynamic Boost Control")
Fixes: febe3ed3222f ("crypto: ccp - Add a sample library for ioctl use")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'tools/crypto/ccp/dbc.py')
-rw-r--r-- | tools/crypto/ccp/dbc.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/crypto/ccp/dbc.py b/tools/crypto/ccp/dbc.py index 3f6a825ffc9e..3956efe7537a 100644 --- a/tools/crypto/ccp/dbc.py +++ b/tools/crypto/ccp/dbc.py @@ -27,8 +27,7 @@ lib = ctypes.CDLL("./dbc_library.so", mode=ctypes.RTLD_GLOBAL) def handle_error(code): - val = code * -1 - raise OSError(val, os.strerror(val)) + raise OSError(code, os.strerror(code)) def get_nonce(device, signature): |