git: 6503ae09604f - stable/13 - LinuxKPI: pci.h: always initialize return value
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 26 Jun 2023 12:08:41 UTC
The branch stable/13 has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=6503ae09604f362e1446583bed30c69a6716b0e6
commit 6503ae09604f362e1446583bed30c69a6716b0e6
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-04-20 15:59:33 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-06-26 09:14:11 +0000
LinuxKPI: pci.h: always initialize return value
In pcie_capability_read_*() always initialize the return value to
avoid warnings of uninitialized values in callers.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39721
(cherry picked from commit 0e8953b94b7481a53945cbd1e16517773996e16e)
---
sys/compat/linuxkpi/common/include/linux/pci.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h
index f8071524c9e0..55435f6b72bc 100644
--- a/sys/compat/linuxkpi/common/include/linux/pci.h
+++ b/sys/compat/linuxkpi/common/include/linux/pci.h
@@ -1198,6 +1198,7 @@ static bool pcie_capability_reg_implemented(struct pci_dev *dev, int pos)
static inline int
pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *dst)
{
+ *dst = 0;
if (pos & 3)
return -EINVAL;
@@ -1210,6 +1211,7 @@ pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *dst)
static inline int
pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *dst)
{
+ *dst = 0;
if (pos & 3)
return -EINVAL;