mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
ALSA: isa: Mark '*_registered' variables as __ro_after_init
The '*_registered' variables are initialized only during the init phase in the '__init' functions and never changed. So, mark them as __ro_after_init to reduce the attack surface. Signed-off-by: Len Bao <len.bao@gmx.us> Link: https://patch.msgid.link/20260524154051.45258-1-len.bao@gmx.us Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
a7147920c4
commit
177be86ecc
|
|
@ -103,8 +103,8 @@ MODULE_PARM_DESC(mpuport, "MPU-401 port # for CMI8330/CMI8329 driver.");
|
|||
module_param_hw_array(mpuirq, int, irq, NULL, 0444);
|
||||
MODULE_PARM_DESC(mpuirq, "IRQ # for CMI8330/CMI8329 MPU-401 port.");
|
||||
#ifdef CONFIG_PNP
|
||||
static int isa_registered;
|
||||
static int pnp_registered;
|
||||
static int isa_registered __ro_after_init;
|
||||
static int pnp_registered __ro_after_init;
|
||||
#endif
|
||||
|
||||
#define CMI8330_RMUX3D 16
|
||||
|
|
|
|||
|
|
@ -69,9 +69,9 @@ module_param_hw_array(dma2, int, dma, NULL, 0444);
|
|||
MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver.");
|
||||
|
||||
#ifdef CONFIG_PNP
|
||||
static int isa_registered;
|
||||
static int pnpc_registered;
|
||||
static int pnp_registered;
|
||||
static int isa_registered __ro_after_init;
|
||||
static int pnpc_registered __ro_after_init;
|
||||
static int pnp_registered __ro_after_init;
|
||||
#endif /* CONFIG_PNP */
|
||||
|
||||
struct snd_card_cs4236 {
|
||||
|
|
|
|||
|
|
@ -1924,9 +1924,9 @@ module_param_hw_array(dma2, int, dma, NULL, 0444);
|
|||
MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver.");
|
||||
|
||||
#ifdef CONFIG_PNP
|
||||
static int isa_registered;
|
||||
static int pnp_registered;
|
||||
static int pnpc_registered;
|
||||
static int isa_registered __ro_after_init;
|
||||
static int pnp_registered __ro_after_init;
|
||||
static int pnpc_registered __ro_after_init;
|
||||
|
||||
static const struct pnp_device_id snd_audiodrive_pnpbiosids[] = {
|
||||
{ .id = "ESS1869" },
|
||||
|
|
|
|||
|
|
@ -111,8 +111,8 @@ struct snd_interwave {
|
|||
|
||||
|
||||
#ifdef CONFIG_PNP
|
||||
static int isa_registered;
|
||||
static int pnp_registered;
|
||||
static int isa_registered __ro_after_init;
|
||||
static int pnp_registered __ro_after_init;
|
||||
|
||||
static const struct pnp_card_device_id snd_interwave_pnpids[] = {
|
||||
#ifndef SNDRV_STB
|
||||
|
|
|
|||
|
|
@ -1199,8 +1199,8 @@ static int snd_msnd_pnp_resume(struct pnp_card_link *pcard)
|
|||
}
|
||||
#endif
|
||||
|
||||
static int isa_registered;
|
||||
static int pnp_registered;
|
||||
static int isa_registered __ro_after_init;
|
||||
static int pnp_registered __ro_after_init;
|
||||
|
||||
static const struct pnp_card_device_id msnd_pnpids[] = {
|
||||
/* Pinnacle PnP */
|
||||
|
|
|
|||
|
|
@ -69,9 +69,9 @@ module_param_array(opl3sa3_ymode, int, NULL, 0444);
|
|||
MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi.");
|
||||
|
||||
#ifdef CONFIG_PNP
|
||||
static int isa_registered;
|
||||
static int pnp_registered;
|
||||
static int pnpc_registered;
|
||||
static int isa_registered __ro_after_init;
|
||||
static int pnp_registered __ro_after_init;
|
||||
static int pnpc_registered __ro_after_init;
|
||||
#endif
|
||||
|
||||
/* control ports */
|
||||
|
|
|
|||
|
|
@ -99,8 +99,8 @@ MODULE_PARM_DESC(seq_ports, "Number of sequencer ports for WaveTable synth.");
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_PNP
|
||||
static int isa_registered;
|
||||
static int pnp_registered;
|
||||
static int isa_registered __ro_after_init;
|
||||
static int pnp_registered __ro_after_init;
|
||||
#endif
|
||||
|
||||
struct snd_card_sb16 {
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ module_param_array(joystick, bool, NULL, 0444);
|
|||
MODULE_PARM_DESC(joystick, "Enable gameport.");
|
||||
|
||||
#ifdef CONFIG_PNP
|
||||
static int isa_registered;
|
||||
static int pnp_registered;
|
||||
static int isa_registered __ro_after_init;
|
||||
static int pnp_registered __ro_after_init;
|
||||
|
||||
static const struct pnp_card_device_id sscape_pnpids[] = {
|
||||
{ .id = "ENS3081", .devs = { { "ENS0000" } } }, /* Soundscape PnP */
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ module_param_array(use_cs4232_midi, bool, NULL, 0444);
|
|||
MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)");
|
||||
|
||||
#ifdef CONFIG_PNP
|
||||
static int isa_registered;
|
||||
static int pnp_registered;
|
||||
static int isa_registered __ro_after_init;
|
||||
static int pnp_registered __ro_after_init;
|
||||
|
||||
static const struct pnp_card_device_id snd_wavefront_pnpids[] = {
|
||||
/* Tropez */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user