summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorKees Cook <kees@kernel.org>2026-02-20 23:49:23 -0800
committerKees Cook <kees@kernel.org>2026-02-21 01:02:28 -0800
commit69050f8d6d075dc01af7a5f2f550a8067510366f (patch)
treebb265f94d9dfa7876c06a5d9f88673d496a15341 /net
parentd39a1d7486d98668dd34aaa6732aad7977c45f5a (diff)
downloadlinux-69050f8d6d075dc01af7a5f2f550a8067510366f.tar.gz
linux-69050f8d6d075dc01af7a5f2f550a8067510366f.tar.bz2
linux-69050f8d6d075dc01af7a5f2f550a8067510366f.zip
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to avoid scalar types (which need careful case-by-case checking), and instead replace kmalloc-family calls that allocate struct or union object instances: Single allocations: kmalloc(sizeof(TYPE), ...) are replaced with: kmalloc_obj(TYPE, ...) Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...) are replaced with: kmalloc_objs(TYPE, COUNT, ...) Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...) are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...) (where TYPE may also be *VAR) The resulting allocations no longer return "void *", instead returning "TYPE *". Signed-off-by: Kees Cook <kees@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/802/garp.c4
-rw-r--r--net/802/mrp.c4
-rw-r--r--net/802/psnap.c2
-rw-r--r--net/8021q/vlan_core.c4
-rw-r--r--net/8021q/vlan_dev.c4
-rw-r--r--net/9p/client.c8
-rw-r--r--net/9p/protocol.c5
-rw-r--r--net/9p/trans_fd.c5
-rw-r--r--net/9p/trans_rdma.c6
-rw-r--r--net/9p/trans_usbg.c6
-rw-r--r--net/9p/trans_virtio.c7
-rw-r--r--net/9p/trans_xen.c5
-rw-r--r--net/appletalk/aarp.c2
-rw-r--r--net/appletalk/ddp.c4
-rw-r--r--net/atm/addr.c2
-rw-r--r--net/atm/br2684.c2
-rw-r--r--net/atm/clip.c2
-rw-r--r--net/atm/lec.c6
-rw-r--r--net/atm/mpc.c4
-rw-r--r--net/atm/mpoa_caches.c4
-rw-r--r--net/atm/pppoatm.c2
-rw-r--r--net/atm/resources.c2
-rw-r--r--net/ax25/af_ax25.c4
-rw-r--r--net/ax25/ax25_dev.c2
-rw-r--r--net/ax25/ax25_iface.c2
-rw-r--r--net/ax25/ax25_in.c2
-rw-r--r--net/ax25/ax25_route.c6
-rw-r--r--net/ax25/ax25_uid.c2
-rw-r--r--net/batman-adv/bat_v_elp.c2
-rw-r--r--net/batman-adv/bridge_loop_avoidance.c4
-rw-r--r--net/batman-adv/distributed-arp-table.c5
-rw-r--r--net/batman-adv/fragmentation.c2
-rw-r--r--net/batman-adv/gateway_client.c2
-rw-r--r--net/batman-adv/hard-interface.c2
-rw-r--r--net/batman-adv/hash.c7
-rw-r--r--net/batman-adv/mesh-interface.c2
-rw-r--r--net/batman-adv/multicast.c6
-rw-r--r--net/batman-adv/originator.c12
-rw-r--r--net/batman-adv/send.c2
-rw-r--r--net/batman-adv/tp_meter.c6
-rw-r--r--net/batman-adv/tvlv.c2
-rw-r--r--net/bluetooth/6lowpan.c6
-rw-r--r--net/bluetooth/cmtp/capi.c2
-rw-r--r--net/bluetooth/cmtp/core.c2
-rw-r--r--net/bluetooth/hci_conn.c12
-rw-r--r--net/bluetooth/hci_core.c22
-rw-r--r--net/bluetooth/hci_sync.c10
-rw-r--r--net/bluetooth/hidp/core.c2
-rw-r--r--net/bluetooth/iso.c2
-rw-r--r--net/bluetooth/l2cap_core.c4
-rw-r--r--net/bluetooth/l2cap_sock.c4
-rw-r--r--net/bluetooth/mgmt.c14
-rw-r--r--net/bluetooth/mgmt_util.c4
-rw-r--r--net/bluetooth/msft.c8
-rw-r--r--net/bluetooth/rfcomm/core.c4
-rw-r--r--net/bluetooth/rfcomm/tty.c4
-rw-r--r--net/bluetooth/sco.c2
-rw-r--r--net/bluetooth/smp.c8
-rw-r--r--net/bpf/bpf_dummy_struct_ops.c6
-rw-r--r--net/bridge/br_cfm.c4
-rw-r--r--net/bridge/br_device.c2
-rw-r--r--net/bridge/br_if.c2
-rw-r--r--net/bridge/br_ioctl.c4
-rw-r--r--net/bridge/br_mdb.c4
-rw-r--r--net/bridge/br_mrp.c2
-rw-r--r--net/bridge/br_multicast.c8
-rw-r--r--net/bridge/br_multicast_eht.c6
-rw-r--r--net/bridge/br_switchdev.c2
-rw-r--r--net/bridge/br_vlan.c8
-rw-r--r--net/bridge/netfilter/ebtables.c2
-rw-r--r--net/caif/caif_dev.c2
-rw-r--r--net/caif/caif_usb.c2
-rw-r--r--net/caif/cfcnfg.c4
-rw-r--r--net/caif/cfctrl.c4
-rw-r--r--net/caif/cfdbgl.c2
-rw-r--r--net/caif/cfdgml.c2
-rw-r--r--net/caif/cffrml.c2
-rw-r--r--net/caif/cfmuxl.c2
-rw-r--r--net/caif/cfrfml.c2
-rw-r--r--net/caif/cfserl.c2
-rw-r--r--net/caif/cfutill.c2
-rw-r--r--net/caif/cfveil.c2
-rw-r--r--net/caif/cfvidl.c2
-rw-r--r--net/can/af_can.c9
-rw-r--r--net/can/gw.c2
-rw-r--r--net/can/j1939/bus.c2
-rw-r--r--net/can/j1939/main.c2
-rw-r--r--net/can/j1939/transport.c2
-rw-r--r--net/ceph/auth.c2
-rw-r--r--net/ceph/auth_none.c4
-rw-r--r--net/ceph/auth_x.c6
-rw-r--r--net/ceph/buffer.c2
-rw-r--r--net/ceph/ceph_common.c11
-rw-r--r--net/ceph/cls_lock_client.c2
-rw-r--r--net/ceph/crypto.c2
-rw-r--r--net/ceph/messenger.c3
-rw-r--r--net/ceph/mon_client.c8
-rw-r--r--net/ceph/osd_client.c28
-rw-r--r--net/ceph/osdmap.c25
-rw-r--r--net/ceph/pagelist.c2
-rw-r--r--net/ceph/pagevec.c2
-rw-r--r--net/ceph/striper.c4
-rw-r--r--net/core/bpf_sk_storage.c2
-rw-r--r--net/core/dev.c25
-rw-r--r--net/core/devmem.c12
-rw-r--r--net/core/drop_monitor.c8
-rw-r--r--net/core/dst.c5
-rw-r--r--net/core/failover.c2
-rw-r--r--net/core/filter.c7
-rw-r--r--net/core/flow_offload.c13
-rw-r--r--net/core/gen_estimator.c2
-rw-r--r--net/core/gro_cells.c2
-rw-r--r--net/core/neighbour.c2
-rw-r--r--net/core/net_namespace.c2
-rw-r--r--net/core/netclassid_cgroup.c2
-rw-r--r--net/core/netpoll.c2
-rw-r--r--net/core/netprio_cgroup.c2
-rw-r--r--net/core/rtnetlink.c4
-rw-r--r--net/core/scm.c2
-rw-r--r--net/core/selftests.c2
-rw-r--r--net/core/skmsg.c2
-rw-r--r--net/core/sock.c2
-rw-r--r--net/core/sock_diag.c2
-rw-r--r--net/core/sock_map.c2
-rw-r--r--net/core/sock_reuseport.c2
-rw-r--r--net/core/xdp.c4
-rw-r--r--net/dcb/dcbnl.c5
-rw-r--r--net/devlink/core.c4
-rw-r--r--net/devlink/dpipe.c2
-rw-r--r--net/devlink/health.c6
-rw-r--r--net/devlink/linecard.c5
-rw-r--r--net/devlink/param.c2
-rw-r--r--net/devlink/rate.c6
-rw-r--r--net/devlink/region.c6
-rw-r--r--net/devlink/resource.c2
-rw-r--r--net/devlink/sb.c2
-rw-r--r--<