linux-stable/samples
Arnd Bergmann 7be3a38f0e samples/hw_breakpoint: fix building without module unloading
[ Upstream commit b9080468ca ]

__symbol_put() is really meant as an internal helper and is not available
when module unloading is disabled, unlike the previously used symbol_put():

samples/hw_breakpoint/data_breakpoint.c: In function 'hw_break_module_exit':
samples/hw_breakpoint/data_breakpoint.c:73:9: error: implicit declaration of function '__symbol_put'; did you mean '__symbol_get'? [-Werror=implicit-function-declaration]

The hw_break_module_exit() function is not actually used when module
unloading is disabled, but it still causes the build failure for an
undefined identifier. Enclose this one call in an appropriate #ifdef to
clarify what the requirement is. Leaving out the entire exit function
would also work but feels less clar in this case.

Fixes: 910e230d5f ("samples/hw_breakpoint: Fix kernel BUG 'invalid opcode: 0000'")
Fixes: d8a84d33a4 ("samples/hw_breakpoint: drop use of kallsyms_lookup_name()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-23 11:01:09 +02:00
..
auxdisplay kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
binderfs kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
bpf samples/bpf: fix broken map lookup probe 2023-09-19 12:20:09 +02:00
configfs samples: configfs: prefer pr_err() over bare printk(KERN_ERR 2020-10-07 15:46:22 +02:00
connector kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
ftrace samples: ftrace: Save required argument registers in sample trampolines 2023-07-27 08:44:31 +02:00
hidraw kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
hw_breakpoint samples/hw_breakpoint: fix building without module unloading 2023-09-23 11:01:09 +02:00
kdb
kfifo kfifo: fix ternary sign extension bugs 2021-05-14 09:50:45 +02:00
kmemleak mm,kmemleak-test.c: move kmemleak-test.c to samples dir 2020-10-13 18:38:27 -07:00
kobject
kprobes samples/kretprobes: Fix return value if register_kretprobe() failed 2021-11-18 14:04:11 +01:00
livepatch
mei kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
nitro_enclaves nitro_enclaves: Add sample for ioctl interface usage 2020-09-22 13:58:41 +02:00
pidfd kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
pktgen samples: pktgen: add missing IPv6 option to pktgen scripts 2021-09-15 09:50:40 +02:00
qmi
rpmsg
seccomp kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
timers kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
trace_events
trace_printk
uhid kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
v4l
vfio-mdev samples: vfio-mdev: Fix missing pci_disable_device() in mdpy_fb_probe() 2023-01-14 10:16:01 +01:00
vfs kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
watch_queue watch_queue: Drop references to /dev/watch_queue 2021-03-04 11:37:59 +01:00
watchdog kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
Kconfig watch_queue: Drop references to /dev/watch_queue 2021-03-04 11:37:59 +01:00
Makefile mm,kmemleak-test.c: move kmemleak-test.c to samples dir 2020-10-13 18:38:27 -07:00