diff mbox series

crypto: hisilicon - Fix sscanf format signedness

Message ID 20210827084310.GA21801@gondor.apana.org.au
State Accepted
Commit cbbb5f07ab737f868f90d429255d5d644280f6a9
Headers show
Series crypto: hisilicon - Fix sscanf format signedness | expand

Commit Message

Herbert Xu Aug. 27, 2021, 8:43 a.m. UTC
On Sun, Aug 22, 2021 at 09:18:20AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   9ff50bf2f2ff5fab01cac26d8eed21a89308e6ef
> commit: 3bbf0783636be8fd672907df25904288f14566f2 crypto: hisilicon/qm - supports to inquiry each function's QoS
> date:   9 weeks ago
> compiler: ia64-linux-gcc (GCC) 11.2.0
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>

---8<---
The function qm_qos_value_init expects an unsigned integer but
is incorrectly supplying a signed format to sscanf.  This patch
fixes it.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
diff mbox series

Patch

diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index 55be00374468..2e9bbec7d1f5 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -4191,7 +4191,7 @@  static ssize_t qm_qos_value_init(const char *buf, unsigned long *val)
 			return -EINVAL;
 	}
 
-	ret = sscanf(buf, "%ld", val);
+	ret = sscanf(buf, "%lu", val);
 	if (ret != QM_QOS_VAL_NUM)
 		return -EINVAL;