crypto: caam - Avoid GCC memset bug warning
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 28 Dec 2022 11:03:32 +0000 (19:03 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 6 Jan 2023 09:15:46 +0000 (17:15 +0800)
commit4f289826fee03571c2784272dd530aae1fd77566
tree5d5c668107debbae1d884bc661e19356eb70b943
parent7361d1bc307b926cbca214ab67b641123c2d6357
crypto: caam - Avoid GCC memset bug warning

Certain versions of gcc don't like the memcpy with a NULL dst
(which only happens with a zero length).  This only happens
when debugging is enabled so add an if clause to work around
these warnings.

A similar warning used to be generated by sparse but that was
fixed years ago.

Link: https://lore.kernel.org/lkml/202210290446.qBayTfzl-lkp@intel.com
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Kees Cook <keescook@chromium.org>
Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/desc_constr.h