From 5e389ef4f4b281e73815ec7661de75c53c2f5ae9 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 11 Oct 2010 10:41:45 -0700 Subject: [PATCH] compat: fix a crash in the netlink backport Do not set the .doit wrapper if there is no .doit function. Signed-off-by: Felix Fietkau --- compat/compat-2.6.37.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compat/compat-2.6.37.c b/compat/compat-2.6.37.c index 52c5a32478e8..d949a929b912 100644 --- a/compat/compat-2.6.37.c +++ b/compat/compat-2.6.37.c @@ -130,7 +130,8 @@ int compat_genl_register_family_with_ops(struct genl_family *family, __copy(dumpit); __copy(done); #undef __copy - ops[i].ops.doit = nl_doit_wrapper; + if (ops[i].doit) + ops[i].ops.doit = nl_doit_wrapper; ret = genl_register_ops(&family->family, &ops[i].ops); if (ret < 0) goto error_ops; -- 2.30.2