mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
drm/amd/display: fix type mismatch error for return variable
It is possible for ret_vsnprintf to be assigned negative value in error cases. As an unsigned variable, negative values which are stored in their 2's complement form gets treated as a positive number. This will led to treating bad cases as good ones. eg: -1 gets stored as 0xFFFFFFFF on a 32 bit system Signed-off-by: Dale Zhao <dale.zhao@amd.com> Reviewed-by: Yongqiang Sun <yongqiang.sun@amd.com> Acked-by: Anson Jacob <Anson.Jacob@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
91a51fbf24
commit
e75f563463
1 changed files with 1 additions and 1 deletions
|
@ -47,7 +47,7 @@
|
|||
|
||||
unsigned int snprintf_count(char *pBuf, unsigned int bufSize, char *fmt, ...)
|
||||
{
|
||||
unsigned int ret_vsnprintf;
|
||||
int ret_vsnprintf;
|
||||
unsigned int chars_printed;
|
||||
|
||||
va_list args;
|
||||
|
|
Loading…
Reference in a new issue