[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <s5hfvi8ky4w.wl%tiwai@suse.de>
Date: Fri, 11 Jul 2014 12:06:39 +0200
From: Takashi Iwai <tiwai@...e.de>
To: Konstantinos Tsimpoukas <kostaslinuxxx@...il.com>
Cc: <alsa-devel@...a-project.org>, Jaroslav Kysela <perex@...ex.cz>,
<linux-sound@...r.kernel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] ice1712: check if snd card loaded, if not do not proceed
At Thu, 10 Jul 2014 23:19:37 -0500,
Konstantinos Tsimpoukas wrote:
>
> Just adding a simple if statement, which
> verifies if actually card is loaded, if not
> does not continue with the execution
> of the snd_card_free.
It's already referenced by ice, so a NULL check must be peformed at
first. But, basically card is always non-NULL. The remove callback
is called only for objects that was properly bound with probe
callback. snd_ice1712_probe() always sets the card pointer when it
succeeds.
thanks,
Takashi
> Signed-off-by: Konstantinos Tsimpoukas <kostaslinuxxx@...il.com>
> ---
> sound/pci/ice1712/ice1712.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
> index d9b9e45..431096b 100644
> --- a/sound/pci/ice1712/ice1712.c
> +++ b/sound/pci/ice1712/ice1712.c
> @@ -2819,7 +2819,8 @@ static void snd_ice1712_remove(struct pci_dev *pci)
>
> if (ice->card_info && ice->card_info->chip_exit)
> ice->card_info->chip_exit(ice);
> - snd_card_free(card);
> + if (card)
> + snd_card_free(card);
> }
>
> #ifdef CONFIG_PM_SLEEP
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists