Skip to contentSkip to conversation

Staging: gdm724x: Make a read-only structure

PATCH Superseded Mihaela Muraru 1 participant 1 message Oct 17, 2016 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: gdm724x: Make a read-only structure

This patch add const qualifier at the declaration of the structure. The structure become a read-only data, this increase the security.

Found with Coccinelle:
@r disable optional_qualifier@
identifier s,i;
@@
* static struct s i ={...};

---
 drivers/staging/gdm724x/gdm_lte.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/gdm724x/gdm_lte.c +1 -1
index e72dfa9..edd9b98 100644
@@ -52,7 +52,7 @@ static struct {
 	struct sock *sock;
 } lte_event;
 
-static struct device_type wwan_type = {
+static const struct device_type wwan_type = {
 	.name   = "wwan",
 };
 
Signature · 1 line
2.7.4