Skip to contentSkip to conversation

crypto: api - Fix build error when modules are disabled

PATCH Herbert Xu 1 participant 1 message Apr 23, 2015 1 message not in the archive Crypto API

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 201504231434.WFmkfUGj%[email protected]

Herbert Xu

author maintainer
#1 lore raw
Quoted 11 lines · kbuild test robot
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
head:   8a1a2b717e0d4d5f3e3bb59b7dee5079a15ab24b
commit: 59afdc7b32143528524455039e7557a46b60e4c8 [42/56] crypto: api - Move module sig ifdef into accessor function
config: xtensa-iss_defconfig (attached as .config)

reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
git checkout 59afdc7b32143528524455039e7557a46b60e4c8

  # save the attached .config to linux build tree
  make.cross ARCH=xtensa 
Quoted 6 lines

All error/warnings:

crypto/algapi.c: In function 'crypto_check_module_sig':

Quoted 1 line
Quoted 1 line

crypto/algapi.c:48:12: error: dereferencing pointer to incomplete type

            mod->name);
               ^

Thanks. This patch should fix the problem.

---8<---
The commit 59afdc7b32143528524455039e7557a46b60e4c8 ("crypto:
api - Move module sig ifdef into accessor function") broke the build when modules are completely disabled because we directly dereference module->name.

This patch fixes this by using the accessor function module_name.

crypto/algapi.c +1 -1
index c63836f..3103e6a 100644
@@ -46,7 +46,7 @@ static inline void crypto_check_module_sig(struct module *mod)
 {
 	if (fips_enabled && mod && !module_sig_ok(mod))
 		panic("Module %s signature verification failed in FIPS mode\n",
-		      mod->name);
+		      module_name(mod));
 }
 
 static int crypto_check_alg(struct crypto_alg *alg)
Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt