linux-sg2042/include
Leon Romanovsky 919d13a7e4 devlink: Set device as early as possible
All kernel devlink implementations call to devlink_alloc() during
initialization routine for specific device which is used later as
a parent device for devlink_register().

Such late device assignment causes to the situation which requires us to
call to device_register() before setting other parameters, but that call
opens devlink to the world and makes accessible for the netlink users.

Any attempt to move devlink_register() to be the last call generates the
following error due to access to the devlink->dev pointer.

[    8.758862]  devlink_nl_param_fill+0x2e8/0xe50
[    8.760305]  devlink_param_notify+0x6d/0x180
[    8.760435]  __devlink_params_register+0x2f1/0x670
[    8.760558]  devlink_params_register+0x1e/0x20

The simple change of API to set devlink device in the devlink_alloc()
instead of devlink_register() fixes all this above and ensures that
prior to call to devlink_register() everything already set.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-08-09 10:21:40 +01:00
..
acpi ACPI: fix NULL pointer dereference 2021-07-24 15:25:54 -07:00
asm-generic compat: make linux/compat.h available everywhere 2021-07-23 14:20:24 +01:00
clocksource
crypto crypto: scatterwalk - Remove obsolete PageSlab check 2021-06-28 11:28:08 +08:00
drm drm: Return -ENOTTY for non-drm ioctls 2021-07-20 15:57:43 +02:00
dt-bindings dt-bindings: clock: r9a07g044-cpg: Update clock/reset definitions 2021-07-12 10:52:03 +02:00
keys
kunit linux-kselftest-kunit-fixes-5.14-rc1 2021-07-02 12:58:26 -07:00
kvm
linux Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-05 15:08:47 -07:00
math-emu math-emu: Fix fall-through warning 2021-07-13 13:57:44 -05:00
media
memory
misc
net devlink: Set device as early as possible 2021-08-09 10:21:40 +01:00
pcmcia
ras
rdma
scsi SCSI misc on 20210702 2021-07-02 15:14:36 -07:00
soc Memory controller drivers for v5.14 - Tegra SoC, late fixes 2021-07-16 22:51:01 +02:00
sound ASoC: Fixes for v5.14 2021-07-21 19:48:09 +02:00
target
trace qdisc: add new field for qdisc_enqueue tracepoint 2021-07-27 14:16:38 +01:00
uapi net/ipv4/ipv6: Replace one-element arraya with flexible-array members 2021-08-05 11:46:42 +01:00
vdso
video
xen xen: sync include/xen/interface/io/ring.h with Xen's newest version 2021-07-05 09:49:45 +02:00