All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: SOF: Fix potential NULL pointer dereference
@ 2022-06-02 13:57 Amadeusz Sławiński
  2022-06-03 19:38 ` Ranjani Sridharan
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Amadeusz Sławiński @ 2022-06-02 13:57 UTC (permalink / raw)
  To: Mark Brown, Pierre-Louis Bossart
  Cc: alsa-devel, Kai Vehmanen, Takashi Iwai, Ranjani Sridharan,
	Liam Girdwood, Amadeusz Sławiński, Daniel Baluta,
	sound-open-firmware

Cleanup path for sof_prepare_widgets_in_path() should check if unprepare
callback exists before calling it, instead it checks if it does not
exist. Fix the check.

Fixes: 370014c8197a ("ASoC: SOF: Add a prepare op to IPC topology widget ops")
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
---
 sound/soc/sof/sof-audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c
index cd41d0599cef..789d0a1f1a77 100644
--- a/sound/soc/sof/sof-audio.c
+++ b/sound/soc/sof/sof-audio.c
@@ -323,7 +323,7 @@ sof_prepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget
 			p->walking = false;
 			if (ret < 0) {
 				/* unprepare the source widget */
-				if (!widget_ops[widget->id].ipc_unprepare && swidget->prepared) {
+				if (widget_ops[widget->id].ipc_unprepare && swidget->prepared) {
 					widget_ops[widget->id].ipc_unprepare(swidget);
 					swidget->prepared = false;
 				}
-- 
2.25.1


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

* Re: [PATCH] ASoC: SOF: Fix potential NULL pointer dereference
  2022-06-02 13:57 [PATCH] ASoC: SOF: Fix potential NULL pointer dereference Amadeusz Sławiński
@ 2022-06-03 19:38 ` Ranjani Sridharan
  2022-06-06 11:31 ` Mark Brown
  2022-06-07 10:45 ` Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Ranjani Sridharan @ 2022-06-03 19:38 UTC (permalink / raw)
  To: Amadeusz Sławiński, Mark Brown, Pierre-Louis Bossart
  Cc: alsa-devel, Kai Vehmanen, Takashi Iwai, Liam Girdwood,
	Daniel Baluta, sound-open-firmware

On Thu, 2022-06-02 at 15:57 +0200, Amadeusz Sławiński wrote:
> Cleanup path for sof_prepare_widgets_in_path() should check if
> unprepare
> callback exists before calling it, instead it checks if it does not
> exist. Fix the check.
> 
> Fixes: 370014c8197a ("ASoC: SOF: Add a prepare op to IPC topology
> widget ops")
> Signed-off-by: Amadeusz Sławiński <
> amadeuszx.slawinski@linux.intel.com>
> ---
>  sound/soc/sof/sof-audio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

LGTM. Thanks for the fix.
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> 
> diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c
> index cd41d0599cef..789d0a1f1a77 100644
> --- a/sound/soc/sof/sof-audio.c
> +++ b/sound/soc/sof/sof-audio.c
> @@ -323,7 +323,7 @@ sof_prepare_widgets_in_path(struct snd_sof_dev
> *sdev, struct snd_soc_dapm_widget
>  			p->walking = false;
>  			if (ret < 0) {
>  				/* unprepare the source widget */
> -				if (!widget_ops[widget-
> >id].ipc_unprepare && swidget->prepared) {
> +				if (widget_ops[widget-
> >id].ipc_unprepare && swidget->prepared) {
>  					widget_ops[widget-
> >id].ipc_unprepare(swidget);
>  					swidget->prepared = false;
>  				}


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

* Re: [PATCH] ASoC: SOF: Fix potential NULL pointer dereference
  2022-06-02 13:57 [PATCH] ASoC: SOF: Fix potential NULL pointer dereference Amadeusz Sławiński
  2022-06-03 19:38 ` Ranjani Sridharan
@ 2022-06-06 11:31 ` Mark Brown
  2022-06-06 13:42   ` Pierre-Louis Bossart
  2022-06-07 10:45 ` Mark Brown
  2 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2022-06-06 11:31 UTC (permalink / raw)
  To: Amadeusz Sławiński
  Cc: Pierre-Louis Bossart, alsa-devel, Kai Vehmanen, Takashi Iwai,
	Liam Girdwood, Ranjani Sridharan, Daniel Baluta,
	sound-open-firmware

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

On Thu, Jun 02, 2022 at 03:57:57PM +0200, Amadeusz Sławiński wrote:
> Cleanup path for sof_prepare_widgets_in_path() should check if unprepare
> callback exists before calling it, instead it checks if it does not
> exist. Fix the check.
> 
> Fixes: 370014c8197a ("ASoC: SOF: Add a prepare op to IPC topology widget ops")

This commit does not exist.

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

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

* Re: [PATCH] ASoC: SOF: Fix potential NULL pointer dereference
  2022-06-06 11:31 ` Mark Brown
@ 2022-06-06 13:42   ` Pierre-Louis Bossart
  0 siblings, 0 replies; 5+ messages in thread
From: Pierre-Louis Bossart @ 2022-06-06 13:42 UTC (permalink / raw)
  To: Mark Brown, Amadeusz Sławiński
  Cc: alsa-devel, Kai Vehmanen, Liam Girdwood, Ranjani Sridharan,
	Takashi Iwai, Daniel Baluta, sound-open-firmware



On 6/6/22 06:31, Mark Brown wrote:
> On Thu, Jun 02, 2022 at 03:57:57PM +0200, Amadeusz Sławiński wrote:
>> Cleanup path for sof_prepare_widgets_in_path() should check if unprepare
>> callback exists before calling it, instead it checks if it does not
>> exist. Fix the check.
>>
>> Fixes: 370014c8197a ("ASoC: SOF: Add a prepare op to IPC topology widget ops")
> 
> This commit does not exist.

Indeed, this SHA was for the SOF tree, the upstream version is this:

66344c6d92113 ("ASoC: SOF: Add a prepare op to IPC topology widget ops")

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

* Re: [PATCH] ASoC: SOF: Fix potential NULL pointer dereference
  2022-06-02 13:57 [PATCH] ASoC: SOF: Fix potential NULL pointer dereference Amadeusz Sławiński
  2022-06-03 19:38 ` Ranjani Sridharan
  2022-06-06 11:31 ` Mark Brown
@ 2022-06-07 10:45 ` Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2022-06-07 10:45 UTC (permalink / raw)
  To: amadeuszx.slawinski, pierre-louis.bossart
  Cc: alsa-devel, kai.vehmanen, Liam Girdwood, Takashi Iwai,
	ranjani.sridharan, daniel.baluta, sound-open-firmware

On Thu, 2 Jun 2022 15:57:57 +0200, Amadeusz Sławiński wrote:
> Cleanup path for sof_prepare_widgets_in_path() should check if unprepare
> callback exists before calling it, instead it checks if it does not
> exist. Fix the check.
> 
> 

Applied to

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

Thanks!

[1/1] ASoC: SOF: Fix potential NULL pointer dereference
      commit: 2fe08216fda33bbc1f80133b8fd560ffd094b987

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

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

end of thread, other threads:[~2022-06-07 10:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02 13:57 [PATCH] ASoC: SOF: Fix potential NULL pointer dereference Amadeusz Sławiński
2022-06-03 19:38 ` Ranjani Sridharan
2022-06-06 11:31 ` Mark Brown
2022-06-06 13:42   ` Pierre-Louis Bossart
2022-06-07 10:45 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.