]> git.openfabrics.org - ~tnikolova/compat/.git/commitdiff
compat: fix a crash in the netlink backport
authorFelix Fietkau <nbd@openwrt.org>
Mon, 11 Oct 2010 17:41:45 +0000 (10:41 -0700)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 11 Oct 2010 17:41:45 +0000 (10:41 -0700)
Do not set the .doit wrapper if there is no .doit function.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
compat/compat-2.6.37.c

index 52c5a32478e8d26dc68ae4dc61d5b5ee2065ec22..d949a929b9125d5bcbe41f20b2c3667972c21c2d 100644 (file)
@@ -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;