* [PATCH AUTOSEL 5.10 05/62] Revert "ALSA: sb: fix a missing check of snd_ctl_add"
[not found] <20210524144744.2497894-1-sashal@kernel.org>
@ 2021-05-24 14:46 ` Sasha Levin
2021-05-24 14:46 ` [PATCH AUTOSEL 5.10 16/62] Revert "ALSA: gus: add a check of the status " Sasha Levin
` (6 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2021-05-24 14:46 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Takashi Iwai, Greg Kroah-Hartman, alsa-devel, Sasha Levin,
Aditya Pakki
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit 4b059ce1f4b368208c2310925f49be77f15e527b ]
This reverts commit beae77170c60aa786f3e4599c18ead2854d8694d.
Because of recent interactions with developers from @umn.edu, all
commits from them have been recently re-reviewed to ensure if they were
correct or not.
Upon review, this commit was found to be incorrect for the reasons
below, so it must be reverted. It is safe to ignore this error as the
mixer element is optional, and the driver is very legacy.
Cc: Aditya Pakki <pakki001@umn.edu>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210503115736.2104747-8-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/isa/sb/sb16_main.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c
index 38dc1fde25f3..aa4870531023 100644
--- a/sound/isa/sb/sb16_main.c
+++ b/sound/isa/sb/sb16_main.c
@@ -846,14 +846,10 @@ int snd_sb16dsp_pcm(struct snd_sb *chip, int device)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_sb16_playback_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_sb16_capture_ops);
- if (chip->dma16 >= 0 && chip->dma8 != chip->dma16) {
- err = snd_ctl_add(card, snd_ctl_new1(
- &snd_sb16_dma_control, chip));
- if (err)
- return err;
- } else {
+ if (chip->dma16 >= 0 && chip->dma8 != chip->dma16)
+ snd_ctl_add(card, snd_ctl_new1(&snd_sb16_dma_control, chip));
+ else
pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
- }
snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
card->dev, 64*1024, 128*1024);
--
2.30.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 5.10 16/62] Revert "ALSA: gus: add a check of the status of snd_ctl_add"
[not found] <20210524144744.2497894-1-sashal@kernel.org>
2021-05-24 14:46 ` [PATCH AUTOSEL 5.10 05/62] Revert "ALSA: sb: fix a missing check of snd_ctl_add" Sasha Levin
@ 2021-05-24 14:46 ` Sasha Levin
2021-05-24 14:46 ` [PATCH AUTOSEL 5.10 17/62] ALSA: sb8: Add a comment note regarding an unused pointer Sasha Levin
` (5 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2021-05-24 14:46 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Takashi Iwai, Greg Kroah-Hartman, alsa-devel, Kangjie Lu,
Sasha Levin
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit 1dacca7fa1ebea47d38d20cd2df37094805d2649 ]
This reverts commit 0f25e000cb4398081748e54f62a902098aa79ec1.
Because of recent interactions with developers from @umn.edu, all
commits from them have been recently re-reviewed to ensure if they were
correct or not.
Upon review, this commit was found to be incorrect for the reasons
below, so it must be reverted. It will be fixed up "correctly" in a
later kernel change.
The original commit did nothing if there was an error, except to print
out a message, which is pointless. So remove the commit as it gives a
"false sense of doing something".
Cc: Kangjie Lu <kjlu@umn.edu>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210503115736.2104747-33-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/isa/gus/gus_main.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c
index afc088f0377c..b7518122a10d 100644
--- a/sound/isa/gus/gus_main.c
+++ b/sound/isa/gus/gus_main.c
@@ -77,17 +77,8 @@ static const struct snd_kcontrol_new snd_gus_joystick_control = {
static void snd_gus_init_control(struct snd_gus_card *gus)
{
- int ret;
-
- if (!gus->ace_flag) {
- ret =
- snd_ctl_add(gus->card,
- snd_ctl_new1(&snd_gus_joystick_control,
- gus));
- if (ret)
- snd_printk(KERN_ERR "gus: snd_ctl_add failed: %d\n",
- ret);
- }
+ if (!gus->ace_flag)
+ snd_ctl_add(gus->card, snd_ctl_new1(&snd_gus_joystick_control, gus));
}
/*
--
2.30.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 5.10 17/62] ALSA: sb8: Add a comment note regarding an unused pointer
[not found] <20210524144744.2497894-1-sashal@kernel.org>
2021-05-24 14:46 ` [PATCH AUTOSEL 5.10 05/62] Revert "ALSA: sb: fix a missing check of snd_ctl_add" Sasha Levin
2021-05-24 14:46 ` [PATCH AUTOSEL 5.10 16/62] Revert "ALSA: gus: add a check of the status " Sasha Levin
@ 2021-05-24 14:46 ` Sasha Levin
2021-05-24 14:46 ` [PATCH AUTOSEL 5.10 18/62] Revert "ALSA: usx2y: Fix potential NULL pointer dereference" Sasha Levin
` (4 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2021-05-24 14:46 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Takashi Iwai, Greg Kroah-Hartman, Atul Gopinathan, alsa-devel,
Sasha Levin
From: Atul Gopinathan <atulgopinathan@gmail.com>
[ Upstream commit a28591f61b60fac820c6de59826ffa710e5e314e ]
The field "fm_res" of "struct snd_sb8" is never used/dereferenced
throughout the sb8.c code. Therefore there is no need for any null value
check after the "request_region()".
Add a comment note to make developers know about this and prevent any
"NULL check" patches on this part of code.
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Atul Gopinathan <atulgopinathan@gmail.com>
Link: https://lore.kernel.org/r/20210503115736.2104747-36-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/isa/sb/sb8.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
index 438109f167d6..fc1ba3d43265 100644
--- a/sound/isa/sb/sb8.c
+++ b/sound/isa/sb/sb8.c
@@ -94,7 +94,11 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)
acard = card->private_data;
card->private_free = snd_sb8_free;
- /* block the 0x388 port to avoid PnP conflicts */
+ /*
+ * Block the 0x388 port to avoid PnP conflicts.
+ * No need to check this value after request_region,
+ * as we never do anything with it.
+ */
acard->fm_res = request_region(0x388, 4, "SoundBlaster FM");
if (!acard->fm_res) {
err = -EBUSY;
--
2.30.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 5.10 18/62] Revert "ALSA: usx2y: Fix potential NULL pointer dereference"
[not found] <20210524144744.2497894-1-sashal@kernel.org>
` (2 preceding siblings ...)
2021-05-24 14:46 ` [PATCH AUTOSEL 5.10 17/62] ALSA: sb8: Add a comment note regarding an unused pointer Sasha Levin
@ 2021-05-24 14:46 ` Sasha Levin
2021-05-24 14:47 ` [PATCH AUTOSEL 5.10 29/62] Revert "ASoC: rt5645: fix a " Sasha Levin
` (3 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2021-05-24 14:46 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Takashi Iwai, Greg Kroah-Hartman, alsa-devel, Sasha Levin,
Aditya Pakki
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit 4667a6fc1777ce071504bab570d3599107f4790f ]
This reverts commit a2c6433ee5a35a8de6d563f6512a26f87835ea0f.
Because of recent interactions with developers from @umn.edu, all
commits from them have been recently re-reviewed to ensure if they were
correct or not.
Upon review, this commit was found to be incorrect for the reasons
below, so it must be reverted. It will be fixed up "correctly" in a
later kernel change.
The original patch was incorrect, and would leak memory if the error
path the patch added was hit.
Cc: Aditya Pakki <pakki001@umn.edu>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210503115736.2104747-37-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/usx2y/usb_stream.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/sound/usb/usx2y/usb_stream.c b/sound/usb/usx2y/usb_stream.c
index 091c071b270a..6bba17bf689a 100644
--- a/sound/usb/usx2y/usb_stream.c
+++ b/sound/usb/usx2y/usb_stream.c
@@ -91,12 +91,7 @@ static int init_urbs(struct usb_stream_kernel *sk, unsigned use_packsize,
for (u = 0; u < USB_STREAM_NURBS; ++u) {
sk->inurb[u] = usb_alloc_urb(sk->n_o_ps, GFP_KERNEL);
- if (!sk->inurb[u])
- return -ENOMEM;
-
sk->outurb[u] = usb_alloc_urb(sk->n_o_ps, GFP_KERNEL);
- if (!sk->outurb[u])
- return -ENOMEM;
}
if (init_pipe_urbs(sk, use_packsize, sk->inurb, indata, dev, in_pipe) ||
--
2.30.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 5.10 29/62] Revert "ASoC: rt5645: fix a NULL pointer dereference"
[not found] <20210524144744.2497894-1-sashal@kernel.org>
` (3 preceding siblings ...)
2021-05-24 14:46 ` [PATCH AUTOSEL 5.10 18/62] Revert "ALSA: usx2y: Fix potential NULL pointer dereference" Sasha Levin
@ 2021-05-24 14:47 ` Sasha Levin
2021-05-25 22:00 ` Mark Brown
2021-05-24 14:47 ` [PATCH AUTOSEL 5.10 30/62] ASoC: rt5645: add error checking to rt5645_probe function Sasha Levin
` (2 subsequent siblings)
7 siblings, 1 reply; 13+ messages in thread
From: Sasha Levin @ 2021-05-24 14:47 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sasha Levin, Greg Kroah-Hartman, alsa-devel, Mark Brown,
Kangjie Lu
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit 1e0ce84215dbfd6065872e5d3755352da34f198b ]
This reverts commit 51dd97d1df5fb9ac58b9b358e63e67b530f6ae21.
Because of recent interactions with developers from @umn.edu, all
commits from them have been recently re-reviewed to ensure if they were
correct or not.
Upon review, this commit was found to be incorrect for the reasons
below, so it must be reverted. It will be fixed up "correctly" in a
later kernel change.
Lots of things seem to be still allocated here and must be properly
cleaned up if an error happens here.
Cc: Kangjie Lu <kjlu@umn.edu>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210503115736.2104747-55-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt5645.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 420003d062c7..ed4b59ba63f3 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3419,9 +3419,6 @@ static int rt5645_probe(struct snd_soc_component *component)
RT5645_HWEQ_NUM, sizeof(struct rt5645_eq_param_s),
GFP_KERNEL);
- if (!rt5645->eq_param)
- return -ENOMEM;
-
return 0;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 5.10 30/62] ASoC: rt5645: add error checking to rt5645_probe function
[not found] <20210524144744.2497894-1-sashal@kernel.org>
` (4 preceding siblings ...)
2021-05-24 14:47 ` [PATCH AUTOSEL 5.10 29/62] Revert "ASoC: rt5645: fix a " Sasha Levin
@ 2021-05-24 14:47 ` Sasha Levin
2021-05-25 21:49 ` Mark Brown
2021-05-24 14:47 ` [PATCH AUTOSEL 5.10 31/62] Revert "ASoC: cs43130: fix a NULL pointer dereference" Sasha Levin
2021-05-24 14:47 ` [PATCH AUTOSEL 5.10 32/62] ASoC: cs43130: handle errors in cs43130_probe() properly Sasha Levin
7 siblings, 1 reply; 13+ messages in thread
From: Sasha Levin @ 2021-05-24 14:47 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sasha Levin, Greg Kroah-Hartman, alsa-devel, Mark Brown,
Phillip Potter
From: Phillip Potter <phil@philpotter.co.uk>
[ Upstream commit 5e70b8e22b64eed13d5bbebcb5911dae65bf8c6b ]
Check for return value from various snd_soc_dapm_* calls, as many of
them can return errors and this should be handled. Also, reintroduce
the allocation failure check for rt5645->eq_param as well. Make all
areas where return values are checked lead to the end of the function
in the case of an error. Finally, introduce a comment explaining how
resources here are actually eventually cleaned up by the caller.
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210503115736.2104747-56-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt5645.c | 48 +++++++++++++++++++++++++++++++--------
1 file changed, 39 insertions(+), 9 deletions(-)
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index ed4b59ba63f3..a5665e992ecb 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3376,30 +3376,44 @@ static int rt5645_probe(struct snd_soc_component *component)
{
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
+ int ret = 0;
rt5645->component = component;
switch (rt5645->codec_type) {
case CODEC_TYPE_RT5645:
- snd_soc_dapm_new_controls(dapm,
+ ret = snd_soc_dapm_new_controls(dapm,
rt5645_specific_dapm_widgets,
ARRAY_SIZE(rt5645_specific_dapm_widgets));
- snd_soc_dapm_add_routes(dapm,
+ if (ret < 0)
+ goto exit;
+
+ ret = snd_soc_dapm_add_routes(dapm,
rt5645_specific_dapm_routes,
ARRAY_SIZE(rt5645_specific_dapm_routes));
+ if (ret < 0)
+ goto exit;
+
if (rt5645->v_id < 3) {
- snd_soc_dapm_add_routes(dapm,
+ ret = snd_soc_dapm_add_routes(dapm,
rt5645_old_dapm_routes,
ARRAY_SIZE(rt5645_old_dapm_routes));
+ if (ret < 0)
+ goto exit;
}
break;
case CODEC_TYPE_RT5650:
- snd_soc_dapm_new_controls(dapm,
+ ret = snd_soc_dapm_new_controls(dapm,
rt5650_specific_dapm_widgets,
ARRAY_SIZE(rt5650_specific_dapm_widgets));
- snd_soc_dapm_add_routes(dapm,
+ if (ret < 0)
+ goto exit;
+
+ ret = snd_soc_dapm_add_routes(dapm,
rt5650_specific_dapm_routes,
ARRAY_SIZE(rt5650_specific_dapm_routes));
+ if (ret < 0)
+ goto exit;
break;
}
@@ -3407,9 +3421,17 @@ static int rt5645_probe(struct snd_soc_component *component)
/* for JD function */
if (rt5645->pdata.jd_mode) {
- snd_soc_dapm_force_enable_pin(dapm, "JD Power");
- snd_soc_dapm_force_enable_pin(dapm, "LDO2");
- snd_soc_dapm_sync(dapm);
+ ret = snd_soc_dapm_force_enable_pin(dapm, "JD Power");
+ if (ret < 0)
+ goto exit;
+
+ ret = snd_soc_dapm_force_enable_pin(dapm, "LDO2");
+ if (ret < 0)
+ goto exit;
+
+ ret = snd_soc_dapm_sync(dapm);
+ if (ret < 0)
+ goto exit;
}
if (rt5645->pdata.long_name)
@@ -3419,7 +3441,15 @@ static int rt5645_probe(struct snd_soc_component *component)
RT5645_HWEQ_NUM, sizeof(struct rt5645_eq_param_s),
GFP_KERNEL);
- return 0;
+ if (!rt5645->eq_param)
+ ret = -ENOMEM;
+exit:
+ /*
+ * If there was an error above, everything will be cleaned up by the
+ * caller if we return an error here. This will be done with a later
+ * call to rt5645_remove().
+ */
+ return ret;
}
static void rt5645_remove(struct snd_soc_component *component)
--
2.30.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 5.10 31/62] Revert "ASoC: cs43130: fix a NULL pointer dereference"
[not found] <20210524144744.2497894-1-sashal@kernel.org>
` (5 preceding siblings ...)
2021-05-24 14:47 ` [PATCH AUTOSEL 5.10 30/62] ASoC: rt5645: add error checking to rt5645_probe function Sasha Levin
@ 2021-05-24 14:47 ` Sasha Levin
2021-05-24 14:47 ` [PATCH AUTOSEL 5.10 32/62] ASoC: cs43130: handle errors in cs43130_probe() properly Sasha Levin
7 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2021-05-24 14:47 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sasha Levin, alsa-devel, Greg Kroah-Hartman, Kangjie Lu,
Mark Brown, patches
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit fdda0dd2686ecd1f2e616c9e0366ea71b40c485d ]
This reverts commit a2be42f18d409213bb7e7a736e3ef6ba005115bb.
Because of recent interactions with developers from @umn.edu, all
commits from them have been recently re-reviewed to ensure if they were
correct or not.
Upon review, this commit was found to be incorrect for the reasons
below, so it must be reverted. It will be fixed up "correctly" in a
later kernel change.
The original patch here is not correct, sysfs files that were created
are not unwound.
Cc: Kangjie Lu <kjlu@umn.edu>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210503115736.2104747-57-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/cs43130.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
index 7fb34422a2a4..bb46e993c353 100644
--- a/sound/soc/codecs/cs43130.c
+++ b/sound/soc/codecs/cs43130.c
@@ -2319,8 +2319,6 @@ static int cs43130_probe(struct snd_soc_component *component)
return ret;
cs43130->wq = create_singlethread_workqueue("cs43130_hp");
- if (!cs43130->wq)
- return -ENOMEM;
INIT_WORK(&cs43130->work, cs43130_imp_meas);
}
--
2.30.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH AUTOSEL 5.10 32/62] ASoC: cs43130: handle errors in cs43130_probe() properly
[not found] <20210524144744.2497894-1-sashal@kernel.org>
` (6 preceding siblings ...)
2021-05-24 14:47 ` [PATCH AUTOSEL 5.10 31/62] Revert "ASoC: cs43130: fix a NULL pointer dereference" Sasha Levin
@ 2021-05-24 14:47 ` Sasha Levin
7 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2021-05-24 14:47 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sasha Levin, Greg Kroah-Hartman, alsa-devel, Mark Brown, patches
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit 2da441a6491d93eff8ffff523837fd621dc80389 ]
cs43130_probe() does not do any valid error checking of things it
initializes, OR what it does, it does not unwind properly if there are
errors.
Fix this up by moving the sysfs files to an attribute group so the
driver core will correctly add/remove them all at once and handle errors
with them, and correctly check for creating a new workqueue and
unwinding if that fails.
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210503115736.2104747-58-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/cs43130.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
index bb46e993c353..8f70dee95878 100644
--- a/sound/soc/codecs/cs43130.c
+++ b/sound/soc/codecs/cs43130.c
@@ -1735,6 +1735,14 @@ static DEVICE_ATTR(hpload_dc_r, 0444, cs43130_show_dc_r, NULL);
static DEVICE_ATTR(hpload_ac_l, 0444, cs43130_show_ac_l, NULL);
static DEVICE_ATTR(hpload_ac_r, 0444, cs43130_show_ac_r, NULL);
+static struct attribute *hpload_attrs[] = {
+ &dev_attr_hpload_dc_l.attr,
+ &dev_attr_hpload_dc_r.attr,
+ &dev_attr_hpload_ac_l.attr,
+ &dev_attr_hpload_ac_r.attr,
+};
+ATTRIBUTE_GROUPS(hpload);
+
static struct reg_sequence hp_en_cal_seq[] = {
{CS43130_INT_MASK_4, CS43130_INT_MASK_ALL},
{CS43130_HP_MEAS_LOAD_1, 0},
@@ -2302,23 +2310,15 @@ static int cs43130_probe(struct snd_soc_component *component)
cs43130->hpload_done = false;
if (cs43130->dc_meas) {
- ret = device_create_file(component->dev, &dev_attr_hpload_dc_l);
- if (ret < 0)
- return ret;
-
- ret = device_create_file(component->dev, &dev_attr_hpload_dc_r);
- if (ret < 0)
- return ret;
-
- ret = device_create_file(component->dev, &dev_attr_hpload_ac_l);
- if (ret < 0)
- return ret;
-
- ret = device_create_file(component->dev, &dev_attr_hpload_ac_r);
- if (ret < 0)
+ ret = sysfs_create_groups(&component->dev->kobj, hpload_groups);
+ if (ret)
return ret;
cs43130->wq = create_singlethread_workqueue("cs43130_hp");
+ if (!cs43130->wq) {
+ sysfs_remove_groups(&component->dev->kobj, hpload_groups);
+ return -ENOMEM;
+ }
INIT_WORK(&cs43130->work, cs43130_imp_meas);
}
--
2.30.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH AUTOSEL 5.10 30/62] ASoC: rt5645: add error checking to rt5645_probe function
2021-05-24 14:47 ` [PATCH AUTOSEL 5.10 30/62] ASoC: rt5645: add error checking to rt5645_probe function Sasha Levin
@ 2021-05-25 21:49 ` Mark Brown
2021-05-25 22:15 ` Phillip Potter
0 siblings, 1 reply; 13+ messages in thread
From: Mark Brown @ 2021-05-25 21:49 UTC (permalink / raw)
To: Sasha Levin
Cc: Greg Kroah-Hartman, alsa-devel, linux-kernel, stable,
Phillip Potter
[-- Attachment #1: Type: text/plain, Size: 1342 bytes --]
On Mon, May 24, 2021 at 10:47:11AM -0400, Sasha Levin wrote:
> From: Phillip Potter <phil@philpotter.co.uk>
>
> [ Upstream commit 5e70b8e22b64eed13d5bbebcb5911dae65bf8c6b ]
>
> Check for return value from various snd_soc_dapm_* calls, as many of
> them can return errors and this should be handled. Also, reintroduce
> the allocation failure check for rt5645->eq_param as well. Make all
Now I've looked at the patch I don't think it's appropriate for
stable, it's essentially equivalent to a patch that adds -Werror
- the changes in it are upgrading things from error messages that
would be generated by what are essentially static checks (even
though we do do them at runtime they're on hard coded strings) to
probe failures which would be a regression. Unfortunately people
do ignore warnings like that in shipping stuff so it's possible
it's happening, we could do an audit to see if it is but it seems
like more effort than it's worth.
The only case I can think where it might help is if we're
managing to OOM during probe() but that feels very unlikely to
happen, and improved handling unlikely to make substantial
difference compared to the risk that the routing warnings are
triggering but being ignored so someone's sound stops working due
to a stable update. Otherwise it won't do much so why risk it?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH AUTOSEL 5.10 29/62] Revert "ASoC: rt5645: fix a NULL pointer dereference"
2021-05-24 14:47 ` [PATCH AUTOSEL 5.10 29/62] Revert "ASoC: rt5645: fix a " Sasha Levin
@ 2021-05-25 22:00 ` Mark Brown
2021-05-26 0:58 ` Sasha Levin
0 siblings, 1 reply; 13+ messages in thread
From: Mark Brown @ 2021-05-25 22:00 UTC (permalink / raw)
To: Sasha Levin
Cc: Greg Kroah-Hartman, alsa-devel, Kangjie Lu, linux-kernel, stable
[-- Attachment #1: Type: text/plain, Size: 734 bytes --]
On Mon, May 24, 2021 at 10:47:10AM -0400, Sasha Levin wrote:
> Lots of things seem to be still allocated here and must be properly
> cleaned up if an error happens here.
That's not true, the core already has cleanup for everything else
(as the followup patch in your series identified, though it was a
bit confused as to how).
> RT5645_HWEQ_NUM, sizeof(struct rt5645_eq_param_s),
> GFP_KERNEL);
>
> - if (!rt5645->eq_param)
> - return -ENOMEM;
> -
Without the followup patch (which I don't think is suitable for
stable) this will just remove error checking. It's not likely to
happen and hence make a difference but on the other hand it
introduces a problem, especially when backported in isolation.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH AUTOSEL 5.10 30/62] ASoC: rt5645: add error checking to rt5645_probe function
2021-05-25 21:49 ` Mark Brown
@ 2021-05-25 22:15 ` Phillip Potter
2021-05-26 10:28 ` Mark Brown
0 siblings, 1 reply; 13+ messages in thread
From: Phillip Potter @ 2021-05-25 22:15 UTC (permalink / raw)
To: Mark Brown
Cc: Sasha Levin, Greg Kroah-Hartman, alsa-devel, linux-kernel, stable
On Tue, May 25, 2021 at 10:49:44PM +0100, Mark Brown wrote:
> On Mon, May 24, 2021 at 10:47:11AM -0400, Sasha Levin wrote:
> > From: Phillip Potter <phil@philpotter.co.uk>
> >
> > [ Upstream commit 5e70b8e22b64eed13d5bbebcb5911dae65bf8c6b ]
> >
> > Check for return value from various snd_soc_dapm_* calls, as many of
> > them can return errors and this should be handled. Also, reintroduce
> > the allocation failure check for rt5645->eq_param as well. Make all
>
> Now I've looked at the patch I don't think it's appropriate for
> stable, it's essentially equivalent to a patch that adds -Werror
> - the changes in it are upgrading things from error messages that
> would be generated by what are essentially static checks (even
> though we do do them at runtime they're on hard coded strings) to
> probe failures which would be a regression. Unfortunately people
> do ignore warnings like that in shipping stuff so it's possible
> it's happening, we could do an audit to see if it is but it seems
> like more effort than it's worth.
>
> The only case I can think where it might help is if we're
> managing to OOM during probe() but that feels very unlikely to
> happen, and improved handling unlikely to make substantial
> difference compared to the risk that the routing warnings are
> triggering but being ignored so someone's sound stops working due
> to a stable update. Otherwise it won't do much so why risk it?
Dear Mark,
So I frankly don't have the experience to disagree with you :-) Your
reasoning certainly seems sound to me. My original motivation for the
patch (after discussion with others within the mentorship process) was
that some other sound SoC drivers do this, an example being the Ux500. I
defer to the decision of the community as a whole of course, and am
happy with whatever is decided.
Regards,
Phil
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH AUTOSEL 5.10 29/62] Revert "ASoC: rt5645: fix a NULL pointer dereference"
2021-05-25 22:00 ` Mark Brown
@ 2021-05-26 0:58 ` Sasha Levin
0 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2021-05-26 0:58 UTC (permalink / raw)
To: Mark Brown
Cc: Greg Kroah-Hartman, alsa-devel, Kangjie Lu, linux-kernel, stable
On Tue, May 25, 2021 at 11:00:33PM +0100, Mark Brown wrote:
>On Mon, May 24, 2021 at 10:47:10AM -0400, Sasha Levin wrote:
>
>> Lots of things seem to be still allocated here and must be properly
>> cleaned up if an error happens here.
>
>That's not true, the core already has cleanup for everything else
>(as the followup patch in your series identified, though it was a
>bit confused as to how).
>
>> RT5645_HWEQ_NUM, sizeof(struct rt5645_eq_param_s),
>> GFP_KERNEL);
>>
>> - if (!rt5645->eq_param)
>> - return -ENOMEM;
>> -
>
>Without the followup patch (which I don't think is suitable for
>stable) this will just remove error checking. It's not likely to
>happen and hence make a difference but on the other hand it
>introduces a problem, especially when backported in isolation.
I'll drop this and the follow up patch, thanks.
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH AUTOSEL 5.10 30/62] ASoC: rt5645: add error checking to rt5645_probe function
2021-05-25 22:15 ` Phillip Potter
@ 2021-05-26 10:28 ` Mark Brown
0 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2021-05-26 10:28 UTC (permalink / raw)
To: Phillip Potter
Cc: Sasha Levin, Greg Kroah-Hartman, alsa-devel, linux-kernel, stable
[-- Attachment #1: Type: text/plain, Size: 1214 bytes --]
On Tue, May 25, 2021 at 11:15:17PM +0100, Phillip Potter wrote:
> On Tue, May 25, 2021 at 10:49:44PM +0100, Mark Brown wrote:
> > Now I've looked at the patch I don't think it's appropriate for
> > stable, it's essentially equivalent to a patch that adds -Werror
> So I frankly don't have the experience to disagree with you :-) Your
> reasoning certainly seems sound to me. My original motivation for the
> patch (after discussion with others within the mentorship process) was
> that some other sound SoC drivers do this, an example being the Ux500. I
> defer to the decision of the community as a whole of course, and am
> happy with whatever is decided.
Right, so there's multiple bits here - there's checking at all,
there's adding the checks to mainline and there's backporting
them to stable. For stable we want to be fairly conservative
about what we're backporting since we want people to be able to
just update without worrying about things breaking on them so
something that increases the severity of existing checks is
particularly risky, if the code were already there and people
would've seen any issues it causes when integrating the kernel
it's a different story since the risks are different.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2021-05-28 14:15 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20210524144744.2497894-1-sashal@kernel.org>
2021-05-24 14:46 ` [PATCH AUTOSEL 5.10 05/62] Revert "ALSA: sb: fix a missing check of snd_ctl_add" Sasha Levin
2021-05-24 14:46 ` [PATCH AUTOSEL 5.10 16/62] Revert "ALSA: gus: add a check of the status " Sasha Levin
2021-05-24 14:46 ` [PATCH AUTOSEL 5.10 17/62] ALSA: sb8: Add a comment note regarding an unused pointer Sasha Levin
2021-05-24 14:46 ` [PATCH AUTOSEL 5.10 18/62] Revert "ALSA: usx2y: Fix potential NULL pointer dereference" Sasha Levin
2021-05-24 14:47 ` [PATCH AUTOSEL 5.10 29/62] Revert "ASoC: rt5645: fix a " Sasha Levin
2021-05-25 22:00 ` Mark Brown
2021-05-26 0:58 ` Sasha Levin
2021-05-24 14:47 ` [PATCH AUTOSEL 5.10 30/62] ASoC: rt5645: add error checking to rt5645_probe function Sasha Levin
2021-05-25 21:49 ` Mark Brown
2021-05-25 22:15 ` Phillip Potter
2021-05-26 10:28 ` Mark Brown
2021-05-24 14:47 ` [PATCH AUTOSEL 5.10 31/62] Revert "ASoC: cs43130: fix a NULL pointer dereference" Sasha Levin
2021-05-24 14:47 ` [PATCH AUTOSEL 5.10 32/62] ASoC: cs43130: handle errors in cs43130_probe() properly Sasha Levin
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).