diff options
Diffstat (limited to 'sound/pci/ymfpci/ymfpci.c')
-rw-r--r-- | sound/pci/ymfpci/ymfpci.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c index 2e69abe51aa9..e50d744ae706 100644 --- a/sound/pci/ymfpci/ymfpci.c +++ b/sound/pci/ymfpci/ymfpci.c | |||
@@ -130,8 +130,7 @@ static int __devinit snd_ymfpci_create_gameport(ymfpci_t *chip, int dev, | |||
130 | chip->gameport = gp = gameport_allocate_port(); | 130 | chip->gameport = gp = gameport_allocate_port(); |
131 | if (!gp) { | 131 | if (!gp) { |
132 | printk(KERN_ERR "ymfpci: cannot allocate memory for gameport\n"); | 132 | printk(KERN_ERR "ymfpci: cannot allocate memory for gameport\n"); |
133 | release_resource(r); | 133 | release_and_free_resource(r); |
134 | kfree_nocheck(r); | ||
135 | return -ENOMEM; | 134 | return -ENOMEM; |
136 | } | 135 | } |
137 | 136 | ||
@@ -161,8 +160,7 @@ void snd_ymfpci_free_gameport(ymfpci_t *chip) | |||
161 | gameport_unregister_port(chip->gameport); | 160 | gameport_unregister_port(chip->gameport); |
162 | chip->gameport = NULL; | 161 | chip->gameport = NULL; |
163 | 162 | ||
164 | release_resource(r); | 163 | release_and_free_resource(r); |
165 | kfree_nocheck(r); | ||
166 | } | 164 | } |
167 | } | 165 | } |
168 | #else | 166 | #else |
@@ -267,14 +265,8 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci, | |||
267 | old_legacy_ctrl, | 265 | old_legacy_ctrl, |
268 | &chip)) < 0) { | 266 | &chip)) < 0) { |
269 | snd_card_free(card); | 267 | snd_card_free(card); |
270 | if (mpu_res) { | 268 | release_and_free_resource(mpu_res); |
271 | release_resource(mpu_res); | 269 | release_and_free_resource(fm_res); |
272 | kfree_nocheck(mpu_res); | ||
273 | } | ||
274 | if (fm_res) { | ||
275 | release_resource(fm_res); | ||
276 | kfree_nocheck(fm_res); | ||
277 | } | ||
278 | return err; | 270 | return err; |
279 | } | 271 | } |
280 | chip->fm_res = fm_res; | 272 | chip->fm_res = fm_res; |