mirror of
https://github.com/sheumann/hush.git
synced 2024-08-22 17:29:34 +00:00
mdev: call index_in_strings on $ACTION only after we checked it for NULL
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
2df1c64f38
commit
d35cbad0ef
@ -1060,15 +1060,15 @@ int mdev_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
* ACTION can be "add", "remove", "change"
|
* ACTION can be "add", "remove", "change"
|
||||||
* DEVPATH is like "/block/sda" or "/class/input/mice"
|
* 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_devname = getenv("DEVNAME"); /* can be NULL */
|
||||||
env_devpath = getenv("DEVPATH");
|
|
||||||
G.subsystem = getenv("SUBSYSTEM");
|
G.subsystem = getenv("SUBSYSTEM");
|
||||||
|
action = getenv("ACTION");
|
||||||
|
env_devpath = getenv("DEVPATH");
|
||||||
if (!action || !env_devpath /*|| !G.subsystem*/)
|
if (!action || !env_devpath /*|| !G.subsystem*/)
|
||||||
bb_show_usage();
|
bb_show_usage();
|
||||||
fw = getenv("FIRMWARE");
|
fw = getenv("FIRMWARE");
|
||||||
seq = getenv("SEQNUM");
|
seq = getenv("SEQNUM");
|
||||||
|
op = index_in_strings(keywords, action);
|
||||||
|
|
||||||
my_pid = getpid();
|
my_pid = getpid();
|
||||||
open_mdev_log(seq, my_pid);
|
open_mdev_log(seq, my_pid);
|
||||||
|
Loading…
Reference in New Issue
Block a user