@@ -2097,15 +2097,27 @@ static void check_for_unused(enum export exp, const char *m, const char *s)
2097
2097
}
2098
2098
}
2099
2099
2100
- static void check_exports (struct module * mod )
2100
+ static int check_exports (struct module * mod )
2101
2101
{
2102
2102
struct symbol * s , * exp ;
2103
+ int err = 0 ;
2103
2104
2104
2105
for (s = mod -> unres ; s ; s = s -> next ) {
2105
2106
const char * basename ;
2106
2107
exp = find_symbol (s -> name );
2107
- if (!exp || exp -> module == mod )
2108
+ if (!exp || exp -> module == mod ) {
2109
+ if (have_vmlinux && !s -> weak ) {
2110
+ if (warn_unresolved ) {
2111
+ warn ("\"%s\" [%s.ko] undefined!\n" ,
2112
+ s -> name , mod -> name );
2113
+ } else {
2114
+ merror ("\"%s\" [%s.ko] undefined!\n" ,
2115
+ s -> name , mod -> name );
2116
+ err = 1 ;
2117
+ }
2118
+ }
2108
2119
continue ;
2120
+ }
2109
2121
basename = strrchr (mod -> name , '/' );
2110
2122
if (basename )
2111
2123
basename ++ ;
@@ -2115,6 +2127,8 @@ static void check_exports(struct module *mod)
2115
2127
check_for_gpl_usage (exp -> export , basename , exp -> name );
2116
2128
check_for_unused (exp -> export , basename , exp -> name );
2117
2129
}
2130
+
2131
+ return err ;
2118
2132
}
2119
2133
2120
2134
static int check_modname_len (struct module * mod )
@@ -2192,19 +2206,8 @@ static int add_versions(struct buffer *b, struct module *mod)
2192
2206
2193
2207
for (s = mod -> unres ; s ; s = s -> next ) {
2194
2208
exp = find_symbol (s -> name );
2195
- if (!exp || exp -> module == mod ) {
2196
- if (have_vmlinux && !s -> weak ) {
2197
- if (warn_unresolved ) {
2198
- warn ("\"%s\" [%s.ko] undefined!\n" ,
2199
- s -> name , mod -> name );
2200
- } else {
2201
- merror ("\"%s\" [%s.ko] undefined!\n" ,
2202
- s -> name , mod -> name );
2203
- err = 1 ;
2204
- }
2205
- }
2209
+ if (!exp || exp -> module == mod )
2206
2210
continue ;
2207
- }
2208
2211
s -> module = exp -> module ;
2209
2212
s -> crc_valid = exp -> crc_valid ;
2210
2213
s -> crc = exp -> crc ;
@@ -2507,7 +2510,7 @@ int main(int argc, char **argv)
2507
2510
buf .pos = 0 ;
2508
2511
2509
2512
err |= check_modname_len (mod );
2510
- check_exports (mod );
2513
+ err |= check_exports (mod );
2511
2514
add_header (& buf , mod );
2512
2515
add_intree_flag (& buf , !external_module );
2513
2516
add_retpoline (& buf );
0 commit comments