diff options
-rw-r--r-- | modutils/modprobe-small.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c index dafe91ed7..cf8a3f0fe 100644 --- a/modutils/modprobe-small.c +++ b/modutils/modprobe-small.c | |||
@@ -635,6 +635,14 @@ static void process_module(char *name, const char *cmdline_options) | |||
635 | infovec = find_alias(name); | 635 | infovec = find_alias(name); |
636 | } | 636 | } |
637 | 637 | ||
638 | if (!infovec) { | ||
639 | /* both dirscan and find_alias found nothing */ | ||
640 | if (!is_rmmod && applet_name[0] != 'd') /* it wasn't rmmod or depmod */ | ||
641 | bb_error_msg("module '%s' not found", name); | ||
642 | //TODO: _and_die()? or should we continue (un)loading modules listed on cmdline? | ||
643 | goto ret; | ||
644 | } | ||
645 | |||
638 | /* There can be more than one module for the given alias. For example, | 646 | /* There can be more than one module for the given alias. For example, |
639 | * "pci:v00008086d00007010sv00000000sd00000000bc01sc01i80" matches | 647 | * "pci:v00008086d00007010sv00000000sd00000000bc01sc01i80" matches |
640 | * ata_piix because it has alias "pci:v00008086d00007010sv*sd*bc*sc*i*" | 648 | * ata_piix because it has alias "pci:v00008086d00007010sv*sd*bc*sc*i*" |
@@ -650,7 +658,8 @@ static void process_module(char *name, const char *cmdline_options) | |||
650 | int r; | 658 | int r; |
651 | char modname[MODULE_NAME_LEN]; | 659 | char modname[MODULE_NAME_LEN]; |
652 | 660 | ||
653 | filename2modname(info->pathname, modname); | 661 | filename2modname( |
662 | bb_get_last_path_component_nostrip(info->pathname), modname); | ||
654 | r = delete_module(modname, O_NONBLOCK | O_EXCL); | 663 | r = delete_module(modname, O_NONBLOCK | O_EXCL); |
655 | dbg1_error_msg("delete_module('%s', O_NONBLOCK | O_EXCL):%d", modname, r); | 664 | dbg1_error_msg("delete_module('%s', O_NONBLOCK | O_EXCL):%d", modname, r); |
656 | if (r != 0) { | 665 | if (r != 0) { |
@@ -673,14 +682,6 @@ static void process_module(char *name, const char *cmdline_options) | |||
673 | */ | 682 | */ |
674 | } | 683 | } |
675 | 684 | ||
676 | if (!infovec) { | ||
677 | /* both dirscan and find_alias found nothing */ | ||
678 | if (!is_rmmod && applet_name[0] != 'd') /* it wasn't rmmod or depmod */ | ||
679 | bb_error_msg("module '%s' not found", name); | ||
680 | //TODO: _and_die()? or should we continue (un)loading modules listed on cmdline? | ||
681 | goto ret; | ||
682 | } | ||
683 | |||
684 | infoidx = 0; | 685 | infoidx = 0; |
685 | while ((info = infovec[infoidx++]) != NULL) { | 686 | while ((info = infovec[infoidx++]) != NULL) { |
686 | /* Iterate thru dependencies, trying to (un)load them */ | 687 | /* Iterate thru dependencies, trying to (un)load them */ |