summaryrefslogtreecommitdiffstats
path: root/sound/drivers/mts64.c
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2016-02-29 07:13:30 -0500
committerTakashi Iwai <tiwai@suse.de>2016-02-29 07:23:46 -0500
commit0bbf7e025fc89ded4925daeaf3619722b13b12d4 (patch)
treeaec62ff32406b1f15e893e63e2cad57941d11415 /sound/drivers/mts64.c
parent1387e3eafa94837342b044b429b79830998009ac (diff)
ALSA: mts64: fix NULL pointer dereference
While registering pardev, the irq_func was also registered. As a result when we tried to probe for the card, an interrupt was generated and in the ISR we tried to dereference private_data. But private_data is still NULL as we have not yet done snd_mts64_create(). Lets probe for the card after mts64 is created. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Fixes: 94a573500d48 ("ALSA: mts64: use new parport device model") Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/drivers/mts64.c')
-rw-r--r--sound/drivers/mts64.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c
index c76bd87071c6..fd4d18df84d3 100644
--- a/sound/drivers/mts64.c
+++ b/sound/drivers/mts64.c
@@ -964,11 +964,6 @@ static int snd_mts64_probe(struct platform_device *pdev)
964 err = -EIO; 964 err = -EIO;
965 goto free_pardev; 965 goto free_pardev;
966 } 966 }
967 err = mts64_probe(p);
968 if (err) {
969 err = -EIO;
970 goto release_pardev;
971 }
972 967
973 if ((err = snd_mts64_create(card, pardev, &mts)) < 0) { 968 if ((err = snd_mts64_create(card, pardev, &mts)) < 0) {
974 snd_printd("Cannot create main component\n"); 969 snd_printd("Cannot create main component\n");
@@ -976,6 +971,12 @@ static int snd_mts64_probe(struct platform_device *pdev)
976 } 971 }
977 card->private_data = mts; 972 card->private_data = mts;
978 card->private_free = snd_mts64_card_private_free; 973 card->private_free = snd_mts64_card_private_free;
974
975 err = mts64_probe(p);
976 if (err) {
977 err = -EIO;
978 goto __err;
979 }
979 980
980 if ((err = snd_mts64_rawmidi_create(card)) < 0) { 981 if ((err = snd_mts64_rawmidi_create(card)) < 0) {
981 snd_printd("Creating Rawmidi component failed\n"); 982 snd_printd("Creating Rawmidi component failed\n");