ALSA: vxpocket: Fix resource leak in vxpocket_probe error path

When vxpocket_config() fails, vxpocket_probe() returns the error code
directly without freeing the sound card resources allocated by
snd_card_new(), which leads to a memory leak.

Add proper error handling to free the sound card and clear the
allocation bit when vxpocket_config() fails.

Fixes: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20251215042652.695-1-vulab@iscas.ac.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by Haotian Zhang and committed by Takashi Iwai 2a03b40d e64826e5

+7 -1
+7 -1
sound/pcmcia/vx/vxpocket.c
··· 284 284 285 285 vxp->p_dev = p_dev; 286 286 287 - return vxpocket_config(p_dev); 287 + err = vxpocket_config(p_dev); 288 + if (err < 0) { 289 + card_alloc &= ~(1 << i); 290 + snd_card_free(card); 291 + return err; 292 + } 293 + return 0; 288 294 } 289 295 290 296 static void vxpocket_detach(struct pcmcia_device *link)