All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: hdac_hdmi: Remove 'edev' NULL check
@ 2016-02-17 11:42 Fabio Estevam
  2016-02-17 12:08 ` Subhransu S. Prusty
  2016-02-17 19:13 ` Applied "ASoC: hdac_hdmi: Remove 'edev' NULL check" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Fabio Estevam @ 2016-02-17 11:42 UTC (permalink / raw)
  To: broonie
  Cc: Fabio Estevam, jeeja.kp, alsa-devel, subhransu.s.prusty, dan.carpenter

Commit 4a3478debf36 ("ASoC: hdac_hdmi: Add jack reporting") 
leads to the following Smatch complaint:

sound/soc/codecs/hdac_hdmi.c:971 hdac_hdmi_present_sense()
         warn: variable dereferenced before check 'edev' (see line 967)

As explained by Subhransu S. Prusty:

"This NULL check is not required, can be removed.

edev object is expected to be present when the present_sense is 
called. This is called from places where this edev object is 
already available."

So remove the evdev NULL check.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
Changes since v1:
- Remove NULL check (Subhransu)

 sound/soc/codecs/hdac_hdmi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index 36f1200..2884dbf 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -968,9 +968,6 @@ static void hdac_hdmi_present_sense(struct hdac_hdmi_pin *pin, int repoll)
 	struct hdac_hdmi_pcm *pcm;
 	int val;
 
-	if (!edev)
-		return;
-
 	pin->repoll_count = repoll;
 
 	pm_runtime_get_sync(&edev->hdac.dev);
-- 
1.9.1

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

* Re: [PATCH v2] ASoC: hdac_hdmi: Remove 'edev' NULL check
  2016-02-17 11:42 [PATCH v2] ASoC: hdac_hdmi: Remove 'edev' NULL check Fabio Estevam
@ 2016-02-17 12:08 ` Subhransu S. Prusty
  2016-02-17 19:13 ` Applied "ASoC: hdac_hdmi: Remove 'edev' NULL check" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Subhransu S. Prusty @ 2016-02-17 12:08 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: jeeja.kp, alsa-devel, broonie, dan.carpenter

On Wed, Feb 17, 2016 at 09:42:13AM -0200, Fabio Estevam wrote:
> Commit 4a3478debf36 ("ASoC: hdac_hdmi: Add jack reporting") 
> leads to the following Smatch complaint:
> 
> sound/soc/codecs/hdac_hdmi.c:971 hdac_hdmi_present_sense()
>          warn: variable dereferenced before check 'edev' (see line 967)
> 
> As explained by Subhransu S. Prusty:
> 
> "This NULL check is not required, can be removed.
> 
> edev object is expected to be present when the present_sense is 
> called. This is called from places where this edev object is 
> already available."
> 
> So remove the evdev NULL check.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>

Acked-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>

> ---
> Changes since v1:
> - Remove NULL check (Subhransu)
> 
>  sound/soc/codecs/hdac_hdmi.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
> index 36f1200..2884dbf 100644
> --- a/sound/soc/codecs/hdac_hdmi.c
> +++ b/sound/soc/codecs/hdac_hdmi.c
> @@ -968,9 +968,6 @@ static void hdac_hdmi_present_sense(struct hdac_hdmi_pin *pin, int repoll)
>  	struct hdac_hdmi_pcm *pcm;
>  	int val;
>  
> -	if (!edev)
> -		return;
> -
>  	pin->repoll_count = repoll;
>  
>  	pm_runtime_get_sync(&edev->hdac.dev);
> -- 
> 1.9.1
> 

-- 

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

* Applied "ASoC: hdac_hdmi: Remove 'edev' NULL check" to the asoc tree
  2016-02-17 11:42 [PATCH v2] ASoC: hdac_hdmi: Remove 'edev' NULL check Fabio Estevam
  2016-02-17 12:08 ` Subhransu S. Prusty
@ 2016-02-17 19:13 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2016-02-17 19:13 UTC (permalink / raw)
  To: Dan Carpenter, Fabio Estevam, Subhransu S. Prusty, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: hdac_hdmi: Remove 'edev' NULL check

has been applied to the asoc tree at

   git://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 cd890ade492784ae06dadd20e688ba1760d3c801 Mon Sep 17 00:00:00 2001
From: Fabio Estevam <fabio.estevam@nxp.com>
Date: Wed, 17 Feb 2016 09:42:13 -0200
Subject: [PATCH] ASoC: hdac_hdmi: Remove 'edev' NULL check

Commit 4a3478debf36 ("ASoC: hdac_hdmi: Add jack reporting")
leads to the following Smatch complaint:

sound/soc/codecs/hdac_hdmi.c:971 hdac_hdmi_present_sense()
         warn: variable dereferenced before check 'edev' (see line 967)

As explained by Subhransu S. Prusty:

"This NULL check is not required, can be removed.

edev object is expected to be present when the present_sense is
called. This is called from places where this edev object is
already available."

So remove the evdev NULL check.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/hdac_hdmi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index 36f12004ae9c..2884dbf0bc07 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -968,9 +968,6 @@ static void hdac_hdmi_present_sense(struct hdac_hdmi_pin *pin, int repoll)
 	struct hdac_hdmi_pcm *pcm;
 	int val;
 
-	if (!edev)
-		return;
-
 	pin->repoll_count = repoll;
 
 	pm_runtime_get_sync(&edev->hdac.dev);
-- 
2.7.0

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

end of thread, other threads:[~2016-02-17 19:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-17 11:42 [PATCH v2] ASoC: hdac_hdmi: Remove 'edev' NULL check Fabio Estevam
2016-02-17 12:08 ` Subhransu S. Prusty
2016-02-17 19:13 ` Applied "ASoC: hdac_hdmi: Remove 'edev' NULL check" to the asoc tree 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.