return genl_get_cmd_small(cmd, family, op);
}
-static void
+static int
genl_cmd_full_to_split(struct genl_split_ops *op,
const struct genl_family *family,
const struct genl_ops *full, u8 flags)
{
+ if ((flags & GENL_CMD_CAP_DO && !full->doit) ||
+ (flags & GENL_CMD_CAP_DUMP && !full->dumpit)) {
+ memset(op, 0, sizeof(*op));
+ return -ENOENT;
+ }
+
if (flags & GENL_CMD_CAP_DUMP) {
op->start = full->start;
op->dumpit = full->dumpit;
/* Make sure flags include the GENL_CMD_CAP_DO / GENL_CMD_CAP_DUMP */
op->flags |= flags;
+
+ return 0;
}
static int
return err;
}
- genl_cmd_full_to_split(op, family, &full, flags);
-
- return 0;
+ return genl_cmd_full_to_split(op, family, &full, flags);
}
static void genl_get_cmd_by_index(unsigned int i,
struct genl_start_context ctx;
int err;
- if (!ops->dumpit)
- return -EOPNOTSUPP;
-
ctx.family = family;
ctx.nlh = nlh;
ctx.extack = extack;
struct genl_info info;
int err;
- if (!ops->doit)
- return -EOPNOTSUPP;
-
attrbuf = genl_family_rcv_msg_attrs_parse(family, nlh, extack,
ops, hdrlen,
GENL_DONT_VALIDATE_STRICT);