From: Michal Marek <mmarek@suse.cz>
Subject: Fix Module.supported handling for external modules
References: bnc#905304
Patch-mainline: Never, SLES feature

The $(srctree)/Module.supported file should only be used when building
the kernel. Likewise for $(objtree)/Module.supported, which is
equivalent to $(dir $(MODVERDIR))/Module.supported when building the
kernel.

Signed-off-by: Michal Marek <mmarek@suse.cz>

---
 scripts/Makefile.modpost |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -84,8 +84,7 @@ modpost = scripts/mod/modpost
  $(if $(cross_build),-c)                         \
  $(if $(CONFIG_ENTERPRISE_SUPPORT),              \
       -N $(firstword $(wildcard $(dir $(MODVERDIR))/Module.supported \
-				$(objtree)/Module.supported \
-				$(srctree)/Module.supported /dev/null)))
+             $(if $(KBUILD_EXTMOD),,$(srctree)/Module.supported) /dev/null)))
 
 quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules
       cmd_modpost = $(modpost) -s
