[PATCH 0/2] ASoC: ams-delta.c: use component after check
Hi Mark, Dan
This patch-set fixup ams-delta.c's 2 warning/error.
[1/2] is for compile error of .receive_buf = cx81801_receive, [2/2] is for static checker warnings
Kuninori Morimoto (2): ASoC: ams-delta.c: fixup cx81801_receive() parameter ASoC: ams-delta.c: use component after check
sound/soc/ti/ams-delta.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
This patch solves below compile error
${LINUX}/sound/soc/ti/ams-delta.c:405:24: error: initialization\ of 'void (*)(struct tty_struct *, const u8 *, const u8 *,\ size_t)' {aka 'void (*)(struct tty_struct *, const unsigned\ char *, const unsigned char *, long unsigned int)'} from \ incompatible pointer type 'void (*)(struct tty_struct *,\ const u8 *, const char *, int)' {aka 'void (*)(struct\ tty_struct *, const unsigned char *, const char *, int)'}\ [-Werror=incompatibl e-pointer-types] 405 | .receive_buf = cx81801_receive, | ^~~~~~~~~~~~~~~
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/ti/ams-delta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/ti/ams-delta.c b/sound/soc/ti/ams-delta.c index 687c1d969285..0c1ff65fcb86 100644 --- a/sound/soc/ti/ams-delta.c +++ b/sound/soc/ti/ams-delta.c @@ -337,7 +337,7 @@ static void cx81801_hangup(struct tty_struct *tty)
/* Line discipline .receive_buf() */ static void cx81801_receive(struct tty_struct *tty, const u8 *cp, - const char *fp, int count) + const u8 *fp, size_t count) { struct snd_soc_component *component = tty->disc_data; const unsigned char *c;
static void cx81801_close() { ... (A) struct snd_soc_dapm_context *dapm = &component->card->dapm; ... (B) if (!component) return; }
(A) uses component before NULL check (B). This patch moves it after (B).
Fixes: d0fdfe34080c ("ASoC: cx20442: replace codec to component") Reported-by: Dan Carpenter dan.carpenter@linaro.org Closes: https://lore.kernel.org/r/3e608474-e99a-4866-ae98-3054a4221f09@moroto.mounta... Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/ti/ams-delta.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/soc/ti/ams-delta.c b/sound/soc/ti/ams-delta.c index 0c1ff65fcb86..bc54124adcb5 100644 --- a/sound/soc/ti/ams-delta.c +++ b/sound/soc/ti/ams-delta.c @@ -303,7 +303,7 @@ static int cx81801_open(struct tty_struct *tty) static void cx81801_close(struct tty_struct *tty) { struct snd_soc_component *component = tty->disc_data; - struct snd_soc_dapm_context *dapm = &component->card->dapm; + struct snd_soc_dapm_context *dapm;
del_timer_sync(&cx81801_timer);
@@ -315,6 +315,8 @@ static void cx81801_close(struct tty_struct *tty)
v253_ops.close(tty);
+ dapm = &component->card->dapm; + /* Revert back to default audio input/output constellation */ snd_soc_dapm_mutex_lock(dapm);
On Fri, Oct 27, 2023 at 12:09:23AM +0000, Kuninori Morimoto wrote:
Hi Mark, Dan
This patch-set fixup ams-delta.c's 2 warning/error.
[1/2] is for compile error of .receive_buf = cx81801_receive, [2/2] is for static checker warnings
Where are you seeing these errors? In particular the first patch looks like an issue that was introduced and fixed in mainline, both sides of that should've been merged up to for-6.7.
On Fri, 27 Oct 2023 00:09:23 +0000, Kuninori Morimoto wrote:
This patch-set fixup ams-delta.c's 2 warning/error.
[1/2] is for compile error of .receive_buf = cx81801_receive, [2/2] is for static checker warnings
Kuninori Morimoto (2): ASoC: ams-delta.c: fixup cx81801_receive() parameter ASoC: ams-delta.c: use component after check
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[2/2] ASoC: ams-delta.c: use component after check commit: bd0f7498bc9084d8cccc5484cd004b40f314b763
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
participants (2)
-
Kuninori Morimoto
-
Mark Brown