alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry
@ 2020-04-15 16:28 Amadeusz Sławiński
  2020-04-15 17:25 ` Mark Brown
  2020-04-16 15:23 ` Applied "ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry" to the asoc tree Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Amadeusz Sławiński @ 2020-04-15 16:28 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Takashi Iwai
  Cc: alsa-devel, Amadeusz Sławiński

If we don't find any pcm, pcm will point at address at an offset from
the the list head and not a meaningful structure. Fix this by returning
correct pcm if found and NULL if not. Found with coccinelle.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
---
 sound/soc/codecs/hdac_hdmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index fba9b749839d..f26b77faed59 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -142,14 +142,14 @@ static struct hdac_hdmi_pcm *
 hdac_hdmi_get_pcm_from_cvt(struct hdac_hdmi_priv *hdmi,
 			   struct hdac_hdmi_cvt *cvt)
 {
-	struct hdac_hdmi_pcm *pcm = NULL;
+	struct hdac_hdmi_pcm *pcm;
 
 	list_for_each_entry(pcm, &hdmi->pcm_list, head) {
 		if (pcm->cvt == cvt)
-			break;
+			return pcm;
 	}
 
-	return pcm;
+	return NULL;
 }
 
 static void hdac_hdmi_jack_report(struct hdac_hdmi_pcm *pcm,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry
  2020-04-15 16:28 [PATCH 1/3] ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry Amadeusz Sławiński
@ 2020-04-15 17:25 ` Mark Brown
  2020-04-16  7:27   ` Amadeusz Sławiński
  2020-04-16 15:23 ` Applied "ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry" to the asoc tree Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2020-04-15 17:25 UTC (permalink / raw)
  To: Amadeusz Sławiński; +Cc: alsa-devel, Liam Girdwood, Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 371 bytes --]

On Wed, Apr 15, 2020 at 12:28:49PM -0400, Amadeusz Sławiński wrote:
> If we don't find any pcm, pcm will point at address at an offset from
> the the list head and not a meaningful structure. Fix this by returning
> correct pcm if found and NULL if not. Found with coccinelle.

I only have patch 1/3 here and no cover letter - what's going on with
dependencies?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry
  2020-04-15 17:25 ` Mark Brown
@ 2020-04-16  7:27   ` Amadeusz Sławiński
  2020-04-16 11:06     ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Amadeusz Sławiński @ 2020-04-16  7:27 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood, Takashi Iwai



On 4/15/2020 7:25 PM, Mark Brown wrote:
> On Wed, Apr 15, 2020 at 12:28:49PM -0400, Amadeusz Sławiński wrote:
>> If we don't find any pcm, pcm will point at address at an offset from
>> the the list head and not a meaningful structure. Fix this by returning
>> correct pcm if found and NULL if not. Found with coccinelle.
> 
> I only have patch 1/3 here and no cover letter - what's going on with
> dependencies?
> 

Oops, I'm sorry about this. There is only this patch, do you want me to 
resend?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry
  2020-04-16  7:27   ` Amadeusz Sławiński
@ 2020-04-16 11:06     ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2020-04-16 11:06 UTC (permalink / raw)
  To: Amadeusz Sławiński; +Cc: alsa-devel, Liam Girdwood, Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 175 bytes --]

On Thu, Apr 16, 2020 at 09:27:29AM +0200, Amadeusz Sławiński wrote:

> Oops, I'm sorry about this. There is only this patch, do you want me to
> resend?

No, it's OK.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Applied "ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry" to the asoc tree
  2020-04-15 16:28 [PATCH 1/3] ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry Amadeusz Sławiński
  2020-04-15 17:25 ` Mark Brown
@ 2020-04-16 15:23 ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2020-04-16 15:23 UTC (permalink / raw)
  To: Amadeusz Sławiński
  Cc: alsa-devel, Mark Brown, Liam Girdwood,
	Amadeusz Sławiński, Takashi Iwai

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2450 bytes --]

The patch

   ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 326b509238171d37402dbe308e154cc234ed1960 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?=
 <amadeuszx.slawinski@linux.intel.com>
Date: Wed, 15 Apr 2020 12:28:49 -0400
Subject: [PATCH] ASoC: codecs: hdac_hdmi: Fix incorrect use of
 list_for_each_entry
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

If we don't find any pcm, pcm will point at address at an offset from
the the list head and not a meaningful structure. Fix this by returning
correct pcm if found and NULL if not. Found with coccinelle.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20200415162849.308-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/hdac_hdmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index fba9b749839d..f26b77faed59 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -142,14 +142,14 @@ static struct hdac_hdmi_pcm *
 hdac_hdmi_get_pcm_from_cvt(struct hdac_hdmi_priv *hdmi,
 			   struct hdac_hdmi_cvt *cvt)
 {
-	struct hdac_hdmi_pcm *pcm = NULL;
+	struct hdac_hdmi_pcm *pcm;
 
 	list_for_each_entry(pcm, &hdmi->pcm_list, head) {
 		if (pcm->cvt == cvt)
-			break;
+			return pcm;
 	}
 
-	return pcm;
+	return NULL;
 }
 
 static void hdac_hdmi_jack_report(struct hdac_hdmi_pcm *pcm,
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-16 15:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15 16:28 [PATCH 1/3] ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry Amadeusz Sławiński
2020-04-15 17:25 ` Mark Brown
2020-04-16  7:27   ` Amadeusz Sławiński
2020-04-16 11:06     ` Mark Brown
2020-04-16 15:23 ` Applied "ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).