]> Git Repo - linux.git/commit
drm/amdgpu: Fix a bug for input with double sscanf
authorLuben Tuikov <[email protected]>
Tue, 13 Apr 2021 11:49:11 +0000 (07:49 -0400)
committerAlex Deucher <[email protected]>
Thu, 15 Apr 2021 20:32:44 +0000 (16:32 -0400)
commit6cb7a1d40acb2425b9dabb99cdaf522bf47295cb
tree6b6fd7a81ac1c662bc4519f9c8563aa5d6185989
parentb45fdeab45bc42c2cd2dfbb3d11a3dd797907af6
drm/amdgpu: Fix a bug for input with double sscanf

Remove double-sscanf to scan for %llu and 0x%llx,
as that is not going to work!

The %llu will consume the "0" in "0x" of your
input, and the hex value you think you're entering
will always be 0. That is, a valid hex value can
never be consumed.

On the other hand, just entering a hex number
without leading 0x will either be scanned as a
string and not match, for instance FAB123, or
the leading decimal portion is scanned as the
%llu, for instance 123FAB will be scanned as 123,
which is not correct.

Thus remove the first %llu scan and leave only the
%llx scan, removing the leading 0x since %llx can
scan either.

Addresses are usually always hex values, so this
suffices.

Cc: Alexander Deucher <[email protected]>
Cc: Xinhui Pan <[email protected]>
Cc: Hawking Zhang <[email protected]>
Signed-off-by: Luben Tuikov <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
This page took 0.055048 seconds and 4 git commands to generate.