Skip to contentSkip to conversation

stable-rc/linux-6.12.y: (build) variable 'val' is uninitialized when passed as a const pointer arg...

REGRESSION KernelCI bot 4 participants 8 messages Nov 24, 2025 – Dec 4, 2025

Subsystems (2)
lore
Share & tools
lore

KernelCI bot

author CI
#0 lore raw

Hello,

New build issue found on stable-rc/linux-6.12.y:

---
variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] in drivers/staging/rtl8712/rtl8712_cmd.o (drivers/staging/rtl8712/rtl8712_cmd.c) [logspec:kbuild,kbuild.compiler.error]
---

- dashboard: https://d.kernelci.org/i/maestro:5b83acc62508c670164c5fceb3079a2d7d74e154
- giturl: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
- commit HEAD: d5dc97879a97b328a89ec092271faa3db9f2bff3
- tags: v6.12.59

Log excerpt:
=====================================================
drivers/staging/rtl8712/rtl8712_cmd.c:148:28: error: variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
148 | memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
| ^~~
1 error generated.

=====================================================

# Builds where the incident occurred:

## defconfig+allmodconfig on (arm64):
- compiler: clang-21
- config: https://files.kernelci.org/kbuild-clang-21-arm64-allmodconfig-6924331af5b8743b1f5e538f/.config
- dashboard: https://d.kernelci.org/build/maestro:6924331af5b8743b1f5e538f

## defconfig+allmodconfig+CONFIG_FRAME_WARN=2048 on (arm):
- compiler: clang-21
- config: https://files.kernelci.org/kbuild-clang-21-arm-allmodconfig-69243317f5b8743b1f5e538c/.config
- dashboard: https://d.kernelci.org/build/maestro:69243317f5b8743b1f5e538c

## i386_defconfig+allmodconfig+CONFIG_FRAME_WARN=2048 on (i386):
- compiler: clang-21
- config: https://files.kernelci.org/kbuild-clang-21-i386-allmodconfig-69243353f5b8743b1f5e53bf/.config
- dashboard: https://d.kernelci.org/build/maestro:69243353f5b8743b1f5e53bf

## x86_64_defconfig+allmodconfig on (x86_64):
- compiler: clang-21
- config: https://files.kernelci.org/kbuild-clang-21-x86-allmodconfig-69243323f5b8743b1f5e5395/.config
- dashboard: https://d.kernelci.org/build/maestro:69243323f5b8743b1f5e5395

#kernelci issue maestro:5b83acc62508c670164c5fceb3079a2d7d74e154

--
This is an experimental report format. Please send feedback in! Talk to us at [email protected]

Made with love by the KernelCI team - https://kernelci.org

#1 lore raw
Quoted 14 lines · KernelCI bot

Hello,

New build issue found on stable-rc/linux-6.12.y:

---
variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] in drivers/staging/rtl8712/rtl8712_cmd.o (drivers/staging/rtl8712/rtl8712_cmd.c) [logspec:kbuild,kbuild.compiler.error]
---

- dashboard: https://d.kernelci.org/i/maestro:5b83acc62508c670164c5fceb3079a2d7d74e154
- giturl: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
- commit HEAD: d5dc97879a97b328a89ec092271faa3db9f2bff3
- tags: v6.12.59

Quoted 6 lines

Log excerpt:
=====================================================
drivers/staging/rtl8712/rtl8712_cmd.c:148:28: error: variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
148 | memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
| ^~~
1 error generated.

This comes from a new subwarning of -Wuninitialized introduced in clang-21:

https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e

This driver was removed upstream in commit 41e883c137eb ("staging:
rtl8712: Remove driver using deprecated API wext") in 6.13 so this only impacts stable.

This certainly does look broken...

  static u8 read_rfreg_hdl(struct _adapter *padapter, u8 *pbuf)
  {
      u32 val;
      void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
      struct cmd_obj *pcmd  = (struct cmd_obj *)pbuf;
      if (pcmd->rsp && pcmd->rspsz > 0)
          memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);

Presumably this is never actually hit? It is rather hard to follow the indirection in this driver but it does not seem like _Read_RFREG is ever set as a cmdcode? Unfortunately, the only maintainer I see listed for this file is Florian Schilhabel but a glance at lore shows no recent activity so that probably won't be too much help. At the very least, we could just zero initialize val, it cannot be any worse than what it is currently doing and copying stack garbage?

Cheers,
Nathan

#2 lore raw
Quoted 43 lines · Nathan Chancellor
Quoted 14 lines · KernelCI bot

Hello,

New build issue found on stable-rc/linux-6.12.y:

---
variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] in drivers/staging/rtl8712/rtl8712_cmd.o (drivers/staging/rtl8712/rtl8712_cmd.c) [logspec:kbuild,kbuild.compiler.error]
---

- dashboard: https://d.kernelci.org/i/maestro:5b83acc62508c670164c5fceb3079a2d7d74e154
- giturl: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
- commit HEAD: d5dc97879a97b328a89ec092271faa3db9f2bff3
- tags: v6.12.59

Quoted 6 lines

Log excerpt:
=====================================================
drivers/staging/rtl8712/rtl8712_cmd.c:148:28: error: variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
148 | memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
| ^~~
1 error generated.

This comes from a new subwarning of -Wuninitialized introduced in clang-21:

https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e

This driver was removed upstream in commit 41e883c137eb ("staging:
rtl8712: Remove driver using deprecated API wext") in 6.13 so this only impacts stable.

This certainly does look broken...

  static u8 read_rfreg_hdl(struct _adapter *padapter, u8 *pbuf)
  {
      u32 val;
      void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
      struct cmd_obj *pcmd  = (struct cmd_obj *)pbuf;
      if (pcmd->rsp && pcmd->rspsz > 0)
          memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
Quoted 8 lines

Presumably this is never actually hit? It is rather hard to follow the indirection in this driver but it does not seem like _Read_RFREG is ever set as a cmdcode? Unfortunately, the only maintainer I see listed for this file is Florian Schilhabel but a glance at lore shows no recent activity so that probably won't be too much help. At the very least, we could just zero initialize val, it cannot be any worse than what it is currently doing and copying stack garbage?

Or backport the patch removing the driver ? It is in staging, after all, so I don't know if there is value in trying to keep it alive in 6.12.y.

Guenter

Quoted 3 lines

Cheers,
Nathan

#3 lore raw
Quoted 53 lines · Guenter Roeck
Quoted 43 lines · Nathan Chancellor
Quoted 14 lines · KernelCI bot

Hello,

New build issue found on stable-rc/linux-6.12.y:

---
variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] in drivers/staging/rtl8712/rtl8712_cmd.o (drivers/staging/rtl8712/rtl8712_cmd.c) [logspec:kbuild,kbuild.compiler.error]
---

- dashboard: https://d.kernelci.org/i/maestro:5b83acc62508c670164c5fceb3079a2d7d74e154
- giturl: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
- commit HEAD: d5dc97879a97b328a89ec092271faa3db9f2bff3
- tags: v6.12.59

Quoted 6 lines

Log excerpt:
=====================================================
drivers/staging/rtl8712/rtl8712_cmd.c:148:28: error: variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
148 | memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
| ^~~
1 error generated.

This comes from a new subwarning of -Wuninitialized introduced in clang-21:

https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e

This driver was removed upstream in commit 41e883c137eb ("staging:
rtl8712: Remove driver using deprecated API wext") in 6.13 so this only impacts stable.

This certainly does look broken...

  static u8 read_rfreg_hdl(struct _adapter *padapter, u8 *pbuf)
  {
      u32 val;
      void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
      struct cmd_obj *pcmd  = (struct cmd_obj *)pbuf;
      if (pcmd->rsp && pcmd->rspsz > 0)
          memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
Quoted 8 lines

Presumably this is never actually hit? It is rather hard to follow the indirection in this driver but it does not seem like _Read_RFREG is ever set as a cmdcode? Unfortunately, the only maintainer I see listed for this file is Florian Schilhabel but a glance at lore shows no recent activity so that probably won't be too much help. At the very least, we could just zero initialize val, it cannot be any worse than what it is currently doing and copying stack garbage?

Quoted 3 lines

Or backport the patch removing the driver ? It is in staging, after all, so I don't know if there is value in trying to keep it alive in 6.12.y.

That would likely not be the end of the world for 6.12.y but this warning appears all the way back to at least 5.15 (the point I start caring about warnings because of CONFIG_WERROR).

Cheers,
Nathan

#4 lore raw
Quoted 54 lines · Nathan Chancellor
Quoted 53 lines · Guenter Roeck
Quoted 51 lines · Nathan Chancellor
Quoted 14 lines · KernelCI bot

Hello,

New build issue found on stable-rc/linux-6.12.y:

---
variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] in drivers/staging/rtl8712/rtl8712_cmd.o (drivers/staging/rtl8712/rtl8712_cmd.c) [logspec:kbuild,kbuild.compiler.error]
---

- dashboard: https://d.kernelci.org/i/maestro:5b83acc62508c670164c5fceb3079a2d7d74e154
- giturl: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
- commit HEAD: d5dc97879a97b328a89ec092271faa3db9f2bff3
- tags: v6.12.59

Quoted 6 lines

Log excerpt:
=====================================================
drivers/staging/rtl8712/rtl8712_cmd.c:148:28: error: variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
148 | memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
| ^~~
1 error generated.

This comes from a new subwarning of -Wuninitialized introduced in clang-21:

https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e

This driver was removed upstream in commit 41e883c137eb ("staging:
rtl8712: Remove driver using deprecated API wext") in 6.13 so this only impacts stable.

This certainly does look broken...

  static u8 read_rfreg_hdl(struct _adapter *padapter, u8 *pbuf)
  {
      u32 val;
      void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
      struct cmd_obj *pcmd  = (struct cmd_obj *)pbuf;
      if (pcmd->rsp && pcmd->rspsz > 0)
          memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);

Presumably this is never actually hit? It is rather hard to follow the indirection in this driver but it does not seem like _Read_RFREG is ever set as a cmdcode? Unfortunately, the only maintainer I see listed for this file is Florian Schilhabel but a glance at lore shows no recent activity so that probably won't be too much help. At the very least, we could just zero initialize val, it cannot be any worse than what it is currently doing and copying stack garbage?

Quoted 7 lines
Quoted 3 lines

Or backport the patch removing the driver ? It is in staging, after all, so I don't know if there is value in trying to keep it alive in 6.12.y.

That would likely not be the end of the world for 6.12.y but this warning appears all the way back to at least 5.15 (the point I start caring about warnings because of CONFIG_WERROR).

No objection from me to delete the driver from all of the stable trees :)

thanks,

greg k-h

#5 lore raw
Quoted 1 line · Greg Kroah-Hartman

No objection from me to delete the driver from all of the stable trees :)

Sounds rather nuclear for the issue at hand :) but I can send the backports for that change and we can see who complains before trying a more localized (even if wrong) fix.

Cheers,
Nathan

#6 lore raw
Quoted 8 lines · Nathan Chancellor
Quoted 1 line · Greg Kroah-Hartman

No objection from me to delete the driver from all of the stable trees :)

Sounds rather nuclear for the issue at hand :) but I can send the backports for that change and we can see who complains before trying a more localized (even if wrong) fix.

Already done (and queued for the next stable releases). Sorry, I wanted to copy you but ended up copying myself.

Guenter

#7 lore raw
Quoted 5 lines · Guenter Roeck
Quoted 4 lines · Nathan Chancellor
Quoted 1 line · Greg Kroah-Hartman

No objection from me to delete the driver from all of the stable trees :)

Quoted 7 lines
Quoted 4 lines

Sounds rather nuclear for the issue at hand :) but I can send the backports for that change and we can see who complains before trying a more localized (even if wrong) fix.

Already done (and queued for the next stable releases). Sorry, I wanted to copy you but ended up copying myself.

Ah great, one less thing for me to do :)

Cheers,
Nathan