Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Lucy Thrun <lucy.thrun@digital-rabbithole.de>
To: tiwai@suse.de
Cc: perex@perex.cz, linux-sound@vger.kernel.org, lkp@intel.com,
	Lucy Thrun <lucy.thrun@digital-rabbithole.de>
Subject: [PATCH v2 1/2] ALSA: hda/ca0132: Fix using plain integer as NULL pointer in add_tuning_control
Date: Tue, 10 Jun 2025 19:50:11 +0200	[thread overview]
Message-ID: <20250610175012.918-2-lucy.thrun@digital-rabbithole.de> (raw)
In-Reply-To: <20250610175012.918-1-lucy.thrun@digital-rabbithole.de>

The 'add_tuning_control' function initializes two pointers using the integer 0 instead of the NULL pointer, triggering sparse warnings.
Replaced both instaces of '0' with 'NULL' to resolve the type mismatch and suppress the sparse warnings.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506100842.d8lwwdwU-lkp@intel.com/

Signed-off-by: Lucy Thrun <lucy.thrun@digital-rabbithole.de>
---
 sound/pci/hda/patch_ca0132.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index cfe422a79703..491d45d652dd 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -4385,8 +4385,8 @@ static int add_tuning_control(struct hda_codec *codec,
 
 	knew.access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
 			SNDRV_CTL_ELEM_ACCESS_TLV_READ;
-	knew.tlv.c = 0;
-	knew.tlv.p = 0;
+	knew.tlv.c = NULL;
+	knew.tlv.p = NULL;
 	switch (pnid) {
 	case VOICE_FOCUS:
 		knew.info = voice_focus_ctl_info;
-- 
2.45.1.windows.1


  reply	other threads:[~2025-06-10 17:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-10 17:50 [PATCH v2 0/2] Regarding recent patches Lucy Thrun
2025-06-10 17:50 ` Lucy Thrun [this message]
2025-06-10 17:50 ` [PATCH v2 2/2] ALSA: hda/ca0132: Fix buffer overflow in add_tuning_control Lucy Thrun
2025-06-10 18:24 ` [PATCH v2 0/2] Regarding recent patches Geraldo Nascimento
2025-06-10 18:24 ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250610175012.918-2-lucy.thrun@digital-rabbithole.de \
    --to=lucy.thrun@digital-rabbithole.de \
    --cc=linux-sound@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox