ALSA: ad1816a: Fix potential NULL pointer deref in snd_card_ad1816a_pnp()
Subsystems (2)
PATCH 1/1 ALSA: ad1816a: Fix potential NULL pointer deref in snd_card_ad1816a_pnp()
Use pr_warn() instead of dev_warn() when 'pdev' is NULL to avoid a potential NULL pointer dereference.
Fixes 20869176d7a7 ("ALSA: ad1816a: Use standard print API")
Signed-off-by Thorsten Blum <[email protected]>
--- sound/isa/ad1816a/ad1816a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/isa/ad1816a/ad1816a.c +1 -1
@@ -98,7 +98,7 @@ static int snd_card_ad1816a_pnp(int dev, struct pnp_card_link *card, pdev =pnp_request_card_device (card, id->devs[1 ].id,NULL );if (pdev ==NULL ) { mpu_port[dev] =-1 ; -dev_warn (&pdev->dev,"MPU401 device busy, skipping.\n" ); +pr_warn ("MPU401 device busy, skipping.\n" );return 0 ; }
Signature · 1 line
2.50.0
Quoted 7 lines · Thorsten Blum
Use
pr_warn()instead ofdev_warn()when 'pdev' is NULL to avoid a potential NULL pointer dereference.Fixes 20869176d7a7 ("ALSA: ad1816a: Use standard print API")Signed-off-by Thorsten Blum <[email protected]>
Applied now. Thanks.
Takashi