]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Staging: android: ion: Make a read-only structure
authorMihaela Muraru <mihaela.muraru21@gmail.com>
Mon, 17 Oct 2016 14:20:18 +0000 (17:20 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Oct 2016 13:33:27 +0000 (15:33 +0200)
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 ={...};

Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/ion/ion_dummy_driver.c

index b23f2c76c753e3fb95b191d98e9639a3294f5209..cf5c010d32bcac356c69df987d4208a5e251a2b0 100644 (file)
@@ -58,7 +58,7 @@ static struct ion_platform_heap dummy_heaps[] = {
                },
 };
 
-static struct ion_platform_data dummy_ion_pdata = {
+static const struct ion_platform_data dummy_ion_pdata = {
        .nr = ARRAY_SIZE(dummy_heaps),
        .heaps = dummy_heaps,
 };