summaryrefslogtreecommitdiff
path: root/drivers/swmodem
diff options
context:
space:
mode:
authorJonas Bonn <jonas@norrbonn.se>2018-10-17 15:36:10 +0200
committerDenis Kenzior <denkenz@gmail.com>2018-10-17 09:56:27 -0500
commit67701b1c40cc088c54027ba06e85ed5ec2727790 (patch)
tree1d541fe75c16be2fa607d9ac54516d36cfff13ee /drivers/swmodem
parentef6c257a3e78e5efbfa07971311427602553b483 (diff)
downloadofono-67701b1c40cc088c54027ba06e85ed5ec2727790.tar.gz
drivers: constify vtables
The driver vtables are read-only structures. This patch declares them as 'const' allowing the compiler to (optionally) put them in the RELRO section. RELRO pages may be marked as read-only by the linker after the relocations have been done ensuring that they aren't inadvertently or maliciously altered at runtime.
Diffstat (limited to 'drivers/swmodem')
-rw-r--r--drivers/swmodem/gprs-context.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/swmodem/gprs-context.c b/drivers/swmodem/gprs-context.c
index 1506ed14..9d450e46 100644
--- a/drivers/swmodem/gprs-context.c
+++ b/drivers/swmodem/gprs-context.c
@@ -245,7 +245,7 @@ static void sw_gprs_context_remove(struct ofono_gprs_context *gc)
g_free(gcd);
}
-static struct ofono_gprs_context_driver driver = {
+static const struct ofono_gprs_context_driver driver = {
.name = "swmodem",
.probe = sw_gprs_context_probe,
.remove = sw_gprs_context_remove,