[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e25f996113e08e37dbfbc3c8ef985ce9423e710f.camel@perches.com>
Date: Fri, 27 Aug 2021 12:33:39 -0700
From: Joe Perches <joe@...ches.com>
To: Herbert Xu <herbert@...dor.apana.org.au>,
kernel test robot <lkp@...el.com>
Cc: Kai Ye <yekai13@...wei.com>, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org,
Linux Crypto Mailing List <linux-crypto@...r.kernel.org>
Subject: Re: crypto: hisilicon - Fix sscanf format signedness
On Fri, 2021-08-27 at 16:43 +0800, Herbert Xu wrote:
> The function qm_qos_value_init expects an unsigned integer but
> is incorrectly supplying a signed format to sscanf. This patch
> fixes it.
[]
> diff --git 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;
QM_QOS_VAL_NUM seems an especially silly define
A direct use of 1 would be _far_ better IMO.
$ git grep -w -n QM_QOS_VAL_NUM
drivers/crypto/hisilicon/qm.c:246:#define QM_QOS_VAL_NUM 1
drivers/crypto/hisilicon/qm.c:4189: if (ret != QM_QOS_VAL_NUM)
Powered by blists - more mailing lists