linux/sound/soc/intel
Pierre-Louis Bossart 64778b022e
ASoC: Intel: bdw_rt286: add checks to avoid static analysis warnings
snd_soc_card_get_codec_dai() can return NULL, but that value is not
checked for, leading to false-positive static analysis warnings

sound/soc/intel/boards/bdw_rt286.c:190:16: error: dereference of NULL
‘codec_dai’ [CWE-476] [-Werror=analyzer-null-dereference]

  190 |         return snd_soc_component_set_jack(codec_dai->component, NULL, NULL);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ‘card_suspend_pre’: event 1
    |
    |  190 |         return snd_soc_component_set_jack(codec_dai->component, NULL, NULL);
    |      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |      |                |
    |      |                (1) dereference of NULL ‘codec_dai’

This NULL dereference cannot happen, the codec-dai "rt286-aif1" must exists
otherwise the card would not be created. Static analysis cannot know
that however so we might as well squelch this report.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Yaochun Hung <yc.hung@mediatek.com>
Link: https://lore.kernel.org/r/20230731213748.440285-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 23:22:17 +01:00
..
atom ASoC: do not include pm_runtime.h if not used 2023-05-23 13:55:55 +01:00
avs ASoC: intel: avs: refactor strncpy usage in topology 2023-07-26 12:49:44 +01:00
boards ASoC: Intel: bdw_rt286: add checks to avoid static analysis warnings 2023-07-31 23:22:17 +01:00
catpt ASoC: Intel: catpt: Convert to platform remove callback returning void 2023-03-20 13:08:33 +00:00
common ASoC: Intel: sof_rt5682: add jsl_rt5650 board config 2023-07-12 14:33:47 +01:00
keembay ASoC: Intel: Migrate to new style legacy DAI naming flag 2022-06-27 13:16:27 +01:00
skylake ASoC: Intel: skl-ssp-clk: Convert to platform remove callback returning void 2023-03-20 13:08:34 +00:00
Kconfig ASoC: Intel: avs: Probe compress operations 2022-12-05 14:05:27 +00:00
Makefile ASoC: Intel: Introduce AVS driver 2022-03-11 16:23:54 +00:00