linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] ASoC: codec: wcd938x: Fix NULL but dereferenced coccicheck error
@ 2022-02-16  2:11 Yang Li
  2022-02-16 11:33 ` Srinivasa Rao Mandadapu
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2022-02-16  2:11 UTC (permalink / raw)
  To: perex
  Cc: tiwai, lgirdwood, broonie, quic_srivasam, alsa-devel,
	linux-kernel, Yang Li, Abaci Robot

Eliminate the following coccicheck warning:
./sound/soc/codecs/wcd938x.c:4210:21-24: ERROR: component is NULL but
dereferenced.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Fixes: 013cc2aea0f6 ("ASoC: codec: wcd938x: Add switch control for selecting CTIA/OMTP Headset")
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 sound/soc/codecs/wcd938x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
index 2663fe0bf64f..c46c4bfd84f2 100644
--- a/sound/soc/codecs/wcd938x.c
+++ b/sound/soc/codecs/wcd938x.c
@@ -4207,7 +4207,7 @@ static bool wcd938x_swap_gnd_mic(struct snd_soc_component *component, bool activ
 	struct wcd938x_priv *wcd938x;
 
 	if (!component) {
-		dev_err(component->dev, "%s component is NULL\n", __func__);
+		pr_err("The snd_soc_component is NULL\n");
 		return false;
 	}
 
-- 
2.20.1.7.g153144c


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

* Re: [PATCH -next] ASoC: codec: wcd938x: Fix NULL but dereferenced coccicheck error
  2022-02-16  2:11 [PATCH -next] ASoC: codec: wcd938x: Fix NULL but dereferenced coccicheck error Yang Li
@ 2022-02-16 11:33 ` Srinivasa Rao Mandadapu
  0 siblings, 0 replies; 2+ messages in thread
From: Srinivasa Rao Mandadapu @ 2022-02-16 11:33 UTC (permalink / raw)
  To: Yang Li, perex
  Cc: tiwai, lgirdwood, broonie, alsa-devel, linux-kernel, Abaci Robot


On 2/16/2022 7:41 AM, Yang Li wrote:
Thanks for Fix Yang!!!
We are going to post complete cleaned patch. Shall we ignore this patch 
for now?
> Eliminate the following coccicheck warning:
> ./sound/soc/codecs/wcd938x.c:4210:21-24: ERROR: component is NULL but
> dereferenced.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Fixes: 013cc2aea0f6 ("ASoC: codec: wcd938x: Add switch control for selecting CTIA/OMTP Headset")
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>   sound/soc/codecs/wcd938x.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
> index 2663fe0bf64f..c46c4bfd84f2 100644
> --- a/sound/soc/codecs/wcd938x.c
> +++ b/sound/soc/codecs/wcd938x.c
> @@ -4207,7 +4207,7 @@ static bool wcd938x_swap_gnd_mic(struct snd_soc_component *component, bool activ
>   	struct wcd938x_priv *wcd938x;
>   
>   	if (!component) {
> -		dev_err(component->dev, "%s component is NULL\n", __func__);
> +		pr_err("The snd_soc_component is NULL\n");
>   		return false;
>   	}
>   

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

end of thread, other threads:[~2022-02-16 11:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16  2:11 [PATCH -next] ASoC: codec: wcd938x: Fix NULL but dereferenced coccicheck error Yang Li
2022-02-16 11:33 ` Srinivasa Rao Mandadapu

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).