Skip to contentSkip to conversation

staging: sm750fb: Make variable read only after initialization.

PATCH New Elise Lennion 1 participant 1 message Oct 18, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: sm750fb: Make variable read only after initialization.

Use __ro_after_init to protect variable, initialized in several steps, from overwrite during runtime.

---

v2: Changed position of __ro_after_init in the same declaration.

 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/sm750fb/sm750.c +1 -1
index 0663ec0..9a49907 100644
@@ -719,7 +719,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
 	return ret;
 }
 
-static struct fb_ops lynxfb_ops = {
+static struct fb_ops lynxfb_ops __ro_after_init = {
 	.owner = THIS_MODULE,
 	.fb_check_var =  lynxfb_ops_check_var,
 	.fb_set_par = lynxfb_ops_set_par,
Signature · 1 line
2.7.4