tipc/bearer: Prevent NULL pointer dereference
Signed-off-by: Phil Sutter <phil@nwl.cc>
This commit is contained in:
parent
75716932a0
commit
70a6df3962
|
|
@ -439,7 +439,7 @@ static int cmd_bearer_enable(struct nlmsghdr *nlh, const struct cmd *cmd,
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
opt = get_opt(opts, "media");
|
opt = get_opt(opts, "media");
|
||||||
if (strcmp(opt->val, "udp") == 0) {
|
if (opt && strcmp(opt->val, "udp") == 0) {
|
||||||
err = nl_add_udp_enable_opts(nlh, opts, cmdl);
|
err = nl_add_udp_enable_opts(nlh, opts, cmdl);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue