mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 16:48:26 +02:00 
			
		
		
		
	module: move check_modinfo() early to early_mod_check()
This moves check_modinfo() to early_mod_check(). This doesn't make any functional changes either, as check_modinfo() was the first call on layout_and_allocate(), so we're just moving it back one routine and at the end. This let's us keep separate the checkers from the allocator. Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
This commit is contained in:
		
							parent
							
								
									85e6f61c13
								
							
						
					
					
						commit
						02da2cbab4
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		|  | @ -2273,10 +2273,6 @@ static struct module *layout_and_allocate(struct load_info *info, int flags) | |||
| 	unsigned int ndx; | ||||
| 	int err; | ||||
| 
 | ||||
| 	err = check_modinfo(info->mod, info, flags); | ||||
| 	if (err) | ||||
| 		return ERR_PTR(err); | ||||
| 
 | ||||
| 	/* Allow arches to frob section contents and sizes.  */ | ||||
| 	err = module_frob_arch_sections(info->hdr, info->sechdrs, | ||||
| 					info->secstrings, info->mod); | ||||
|  | @ -2690,6 +2686,10 @@ static int early_mod_check(struct load_info *info, int flags) | |||
| 	if (!check_modstruct_version(info, info->mod)) | ||||
| 		return -ENOEXEC; | ||||
| 
 | ||||
| 	err = check_modinfo(info->mod, info, flags); | ||||
| 	if (err) | ||||
| 		return err; | ||||
| 
 | ||||
| 	return 0; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Luis Chamberlain
						Luis Chamberlain