]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
staging: rtl8192e: Constify struct pci_device_id
authorRiyan Dhiman <riyandhiman14@gmail.com>
Sat, 31 Aug 2024 16:08:31 +0000 (21:38 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Sep 2024 08:34:51 +0000 (10:34 +0200)
static variable struct pci_device_id rtl8192_pci_id_tbl is not modified
in file rtl_core.c.

Constifying this structure moves some data to a read-only section, so
increase overall security.

Before
======
   text    data     bss     dec     hex filename
  17838     893       1   18732    492c drivers/staging/rtl8192e/rtl8192e/rtl_core.o

After
=====
  text    data     bss     dec     hex filename
  18006     725       1   18732    492c drivers/staging/rtl8192e/rtl8192e/rtl_core.o

Signed-off-by: Riyan Dhiman <riyandhiman14@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20240831160831.121720-1-riyandhiman14@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/rtl_core.c

index 75192041008d7e06d043f257891d296240e9661f..744588a273028ddf1a313974d954f0fd98b144c2 100644 (file)
@@ -25,7 +25,7 @@
 int hwwep = 1;
 static char *ifname = "wlan%d";
 
-static struct pci_device_id rtl8192_pci_id_tbl[] = {
+static const struct pci_device_id rtl8192_pci_id_tbl[] = {
        {PCI_DEVICE(0x10ec, 0x8192)},
        {PCI_DEVICE(0x07aa, 0x0044)},
        {PCI_DEVICE(0x07aa, 0x0047)},