]> git.dujemihanovic.xyz Git - u-boot.git/commit
cpu: microblaze: add error handling in microblaze_cpu_get_desc()
authorOvidiu Panait <ovpanait@gmail.com>
Mon, 29 Aug 2022 17:02:03 +0000 (20:02 +0300)
committerMichal Simek <michal.simek@amd.com>
Tue, 13 Sep 2022 09:32:48 +0000 (11:32 +0200)
commit3f351cd358a3581844f3cacdfe60710bf925d75d
tree546f6c4cbfc93a9ee9436645fc3aedfe48beff0c
parent3a6948ce711b8c7692a3e717021cc2b47e69fce7
cpu: microblaze: add error handling in microblaze_cpu_get_desc()

Check snprintf() return value for errors.

Make microblaze_cpu_get_desc() directly return snprintf() error code if
ret < 0. Otherwise, if the return value is greater than or equal to size,
the resulting string is truncated, so return -ENOSPC.

Fixes: 816226d27e ("cpu: add CPU driver for microblaze")
Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
Link: https://lore.kernel.org/r/20220829170205.1274484-2-ovpanait@gmail.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
drivers/cpu/microblaze_cpu.c