mirror of
https://github.com/torvalds/linux.git
synced 2026-09-14 16:10:02 +02:00
module/dups: Use strcmp() to compare module names
Use strcmp() instead of strlen()+memcmp() to compare module names in kmod_dup_request_lookup(), since all strings are NUL-terminated. Reviewed-by: Aaron Tomlin <atomlin@atomlin.com> Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
This commit is contained in:
parent
c85e76535b
commit
cc6e79b208
|
|
@ -72,11 +72,9 @@ static struct kmod_dup_req *kmod_dup_request_lookup(char *module_name)
|
|||
lockdep_assert_held(&kmod_dup_mutex);
|
||||
|
||||
list_for_each_entry(kmod_req, &dup_kmod_reqs, list) {
|
||||
if (strlen(kmod_req->name) == strlen(module_name) &&
|
||||
!memcmp(kmod_req->name, module_name, strlen(module_name))) {
|
||||
if (!strcmp(kmod_req->name, module_name))
|
||||
return kmod_req;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user