backports: don't use __ro_after_init with genl families on <=4.9

4.9 introduced __ro_after_init, but generic netlink family
registration was only changed to allow it in 4.10, otherwise
deregistration will crash due to writing to the RO memory.

Unfortunately, spatch doesn't handle this, so manually patch
the families to replace __ro_after_init with __genl_ro_after_init
which is defined to nothing on kernel version <= 4.9.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 files changed