crypto: ccp - Fix DBC sample application error handling
authorMario Limonciello <mario.limonciello@amd.com>
Tue, 29 Aug 2023 15:07:57 +0000 (10:07 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:59:18 +0000 (11:59 +0100)
commit3b1ea9069ae763d1d99279cc63d05a52222e285a
tree81721144dfa743502227c86455bcf74701abf820
parent9670d536295c65779bf4bd3948ab3c5a673daf4a
crypto: ccp - Fix DBC sample application error handling

[ Upstream commit 70f242c1933e9e881c13c31640bb6d56e8b7e738 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/crypto/ccp/dbc.c
tools/crypto/ccp/dbc.py