diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-04-02 14:37:06 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-04-02 14:37:06 +0200 |
commit | d35cbad0efaa57bf7c5280e62825966f7757906a (patch) | |
tree | 9deaad26de4d1683d8ca784899901b256d1e067e /util-linux | |
parent | 2df1c64f388576f113abd6f7a3696fa8bef58304 (diff) | |
download | busybox-d35cbad0efaa57bf7c5280e62825966f7757906a.tar.gz |
mdev: call index_in_strings on $ACTION only after we checked it for NULL
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/mdev.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c index 5fe6bbbde..1d741367e 100644 --- a/util-linux/mdev.c +++ b/util-linux/mdev.c @@ -1060,15 +1060,15 @@ int mdev_main(int argc UNUSED_PARAM, char **argv) * ACTION can be "add", "remove", "change" * DEVPATH is like "/block/sda" or "/class/input/mice" */ - action = getenv("ACTION"); - op = index_in_strings(keywords, action); env_devname = getenv("DEVNAME"); /* can be NULL */ - env_devpath = getenv("DEVPATH"); G.subsystem = getenv("SUBSYSTEM"); + action = getenv("ACTION"); + env_devpath = getenv("DEVPATH"); if (!action || !env_devpath /*|| !G.subsystem*/) bb_show_usage(); fw = getenv("FIRMWARE"); seq = getenv("SEQNUM"); + op = index_in_strings(keywords, action); my_pid = getpid(); open_mdev_log(seq, my_pid); |