mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Cc: perex@perex.cz, tiwai@suse.com, krzysztof.h1@wp.pl,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] cs423x: cs4236: fix an incorrect NULL check on list iterator
Date: Sun, 27 Mar 2022 10:33:19 +0200	[thread overview]
Message-ID: <s5hwngflrqo.wl-tiwai@suse.de> (raw)
In-Reply-To: <20220327060822.4735-1-xiam0nd.tong@gmail.com>

On Sun, 27 Mar 2022 08:08:22 +0200,
Xiaomeng Tong wrote:
> 
> The bug is here:
> 	err = snd_card_cs423x_pnp(dev, card->private_data, pdev, cdev);
> 
> The list iterator value 'cdev' will *always* be set and non-NULL
> by list_for_each_entry(), so it is incorrect to assume that the
> iterator value will be NULL if the list is empty or no element
> is found.
> 
> To fix the bug, use a new variable 'iter' as the list iterator,
> while use the original variable 'cdev' as a dedicated pointer
> to point to the found element. And snd_card_cs423x_pnp() itself
> has NULL check for cdev.
> 
> Cc: stable@vger.kernel.org
> Fixes: c2b73d1458014 ("ALSA: cs4236: cs4232 and cs4236 driver merge to solve PnP BIOS detection")
> Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>

Thanks, applied now.


Takashi

      reply	other threads:[~2022-03-27  8:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-27  6:08 Xiaomeng Tong
2022-03-27  8:33 ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hwngflrqo.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=krzysztof.h1@wp.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.com \
    --cc=xiam0nd.tong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®