Convert 'alloc_obj' family to use the new default GFP_KERNEL argument

This was done entirely with mindless brute force, using

    git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds
2026-02-21 16:37:42 -08:00
parent e19e1b480a
commit bf4afc53b7
6673 changed files with 13013 additions and 13013 deletions

View File

@@ -686,7 +686,7 @@ int ad_dpot_probe(struct device *dev,
struct dpot_data *data;
int i, err = 0;
data = kzalloc_obj(struct dpot_data, GFP_KERNEL);
data = kzalloc_obj(struct dpot_data);
if (!data) {
err = -ENOMEM;
goto exit;

View File

@@ -290,13 +290,13 @@ static int altera_execute(struct altera_state *astate,
if (sym_count <= 0)
goto exit_done;
vars = kzalloc_objs(long, sym_count, GFP_KERNEL);
vars = kzalloc_objs(long, sym_count);
if (vars == NULL)
status = -ENOMEM;
if (status == 0) {
var_size = kzalloc_objs(s32, sym_count, GFP_KERNEL);
var_size = kzalloc_objs(s32, sym_count);
if (var_size == NULL)
status = -ENOMEM;
@@ -2342,7 +2342,7 @@ static int altera_get_act_info(u8 *p,
(p[proc_table + (13 * act_proc_id) + 8] & 0x03);
procptr =
kzalloc_obj(struct altera_procinfo, GFP_KERNEL);
kzalloc_obj(struct altera_procinfo);
if (procptr == NULL)
status = -ENOMEM;
@@ -2398,7 +2398,7 @@ int altera_init(struct altera_config *config, const struct firmware *fw)
retval = -ENOMEM;
goto free_key;
}
astate = kzalloc_obj(struct altera_state, GFP_KERNEL);
astate = kzalloc_obj(struct altera_state);
if (!astate) {
retval = -ENOMEM;
goto free_value;

View File

@@ -217,7 +217,7 @@ static int apds9802als_probe(struct i2c_client *client)
int res;
struct als_data *data;
data = kzalloc_obj(struct als_data, GFP_KERNEL);
data = kzalloc_obj(struct als_data);
if (data == NULL) {
dev_err(&client->dev, "Memory allocation failed\n");
return -ENOMEM;

View File

@@ -1055,7 +1055,7 @@ static int apds990x_probe(struct i2c_client *client)
struct apds990x_chip *chip;
int err;
chip = kzalloc_obj(*chip, GFP_KERNEL);
chip = kzalloc_obj(*chip);
if (!chip)
return -ENOMEM;

View File

@@ -1289,7 +1289,7 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
u32 boot_status;
/* allocate vk structure which is tied to kref for freeing */
vk = kzalloc_obj(*vk, GFP_KERNEL);
vk = kzalloc_obj(*vk);
if (!vk)
return -ENOMEM;

View File

@@ -60,7 +60,7 @@ static int bcm_vk_dma_alloc(struct device *dev,
dma->nr_pages = last - first + 1;
/* Allocate DMA pages */
dma->pages = kmalloc_objs(struct page *, dma->nr_pages, GFP_KERNEL);
dma->pages = kmalloc_objs(struct page *, dma->nr_pages);
if (!dma->pages)
return -ENOMEM;

View File

@@ -912,7 +912,7 @@ struct c2port_device *c2port_device_register(char *name,
unlikely(!ops->c2d_get) || unlikely(!ops->c2d_set))
return ERR_PTR(-EINVAL);
c2dev = kzalloc_obj(struct c2port_device, GFP_KERNEL);
c2dev = kzalloc_obj(struct c2port_device);
if (unlikely(!c2dev))
return ERR_PTR(-ENOMEM);

View File

@@ -1385,7 +1385,7 @@ static int rtsx_pci_init_chip(struct rtsx_pcr *pcr)
pcr_dbg(pcr, "PID: 0x%04x, IC version: 0x%02x\n",
PCI_PID(pcr), pcr->ic_version);
pcr->slots = kzalloc_objs(struct rtsx_slot, pcr->num_slots, GFP_KERNEL);
pcr->slots = kzalloc_objs(struct rtsx_slot, pcr->num_slots);
if (!pcr->slots)
return -ENOMEM;
@@ -1493,13 +1493,13 @@ static int rtsx_pci_probe(struct pci_dev *pcidev,
if (ret)
goto disable;
pcr = kzalloc_obj(*pcr, GFP_KERNEL);
pcr = kzalloc_obj(*pcr);
if (!pcr) {
ret = -ENOMEM;
goto release_pci;
}
handle = kzalloc_obj(*handle, GFP_KERNEL);
handle = kzalloc_obj(*handle);
if (!handle) {
ret = -ENOMEM;
goto free_pcr;

View File

@@ -187,7 +187,7 @@ struct cs5535_mfgpt_timer *cs5535_mfgpt_alloc_timer(int timer_nr, int domain)
if (timer_nr < 0)
goto done;
timer = kmalloc_obj(*timer, GFP_KERNEL);
timer = kmalloc_obj(*timer);
if (!timer) {
/* aw hell */
spin_lock_irqsave(&mfgpt->lock, flags);

View File

@@ -144,7 +144,7 @@ static int max6875_probe(struct i2c_client *client)
if (client->addr & 1)
return -ENODEV;
data = kzalloc_obj(struct max6875_data, GFP_KERNEL);
data = kzalloc_obj(struct max6875_data);
if (!data)
return -ENOMEM;

View File

@@ -424,7 +424,7 @@ static int __fastrpc_buf_alloc(struct fastrpc_user *fl, struct device *dev,
{
struct fastrpc_buf *buf;
buf = kzalloc_obj(*buf, GFP_KERNEL);
buf = kzalloc_obj(*buf);
if (!buf)
return -ENOMEM;
@@ -600,7 +600,7 @@ static struct fastrpc_invoke_ctx *fastrpc_context_alloc(
unsigned long flags;
int ret;
ctx = kzalloc_obj(*ctx, GFP_KERNEL);
ctx = kzalloc_obj(*ctx);
if (!ctx)
return ERR_PTR(-ENOMEM);
@@ -611,7 +611,7 @@ static struct fastrpc_invoke_ctx *fastrpc_context_alloc(
REMOTE_SCALARS_OUTBUFS(sc);
if (ctx->nscalars) {
ctx->maps = kzalloc_objs(*ctx->maps, ctx->nscalars, GFP_KERNEL);
ctx->maps = kzalloc_objs(*ctx->maps, ctx->nscalars);
if (!ctx->maps) {
kfree(ctx);
return ERR_PTR(-ENOMEM);
@@ -704,7 +704,7 @@ static int fastrpc_dma_buf_attach(struct dma_buf *dmabuf,
struct fastrpc_buf *buffer = dmabuf->priv;
int ret;
a = kzalloc_obj(*a, GFP_KERNEL);
a = kzalloc_obj(*a);
if (!a)
return -ENOMEM;
@@ -786,7 +786,7 @@ static int fastrpc_map_attach(struct fastrpc_user *fl, int fd,
struct scatterlist *sgl = NULL;
int err = 0, sgl_index = 0;
map = kzalloc_obj(*map, GFP_KERNEL);
map = kzalloc_obj(*map);
if (!map)
return -ENOMEM;
@@ -1432,7 +1432,7 @@ static int fastrpc_init_create_process(struct fastrpc_user *fl,
u32 sc;
bool unsigned_module = false;
args = kzalloc_objs(*args, FASTRPC_CREATE_PROCESS_NARGS, GFP_KERNEL);
args = kzalloc_objs(*args, FASTRPC_CREATE_PROCESS_NARGS);
if (!args)
return -ENOMEM;
@@ -1627,7 +1627,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp)
fdevice = miscdev_to_fdevice(filp->private_data);
cctx = fdevice->cctx;
fl = kzalloc_obj(*fl, GFP_KERNEL);
fl = kzalloc_obj(*fl);
if (!fl)
return -ENOMEM;
@@ -1734,7 +1734,7 @@ static int fastrpc_invoke(struct fastrpc_user *fl, char __user *argp)
/* nscalars is truncated here to max supported value */
nscalars = REMOTE_SCALARS_LENGTH(inv.sc);
if (nscalars) {
args = kzalloc_objs(*args, nscalars, GFP_KERNEL);
args = kzalloc_objs(*args, nscalars);
if (!args)
return -ENOMEM;
@@ -2371,7 +2371,7 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
else if (!qcom_scm_is_available())
return -EPROBE_DEFER;
data = kzalloc_obj(*data, GFP_KERNEL);
data = kzalloc_obj(*data);
if (!data)
return -ENOMEM;

View File

@@ -141,7 +141,7 @@ static struct genwqe_dev *genwqe_dev_alloc(void)
if (i >= GENWQE_CARD_NO_MAX)
return ERR_PTR(-ENODEV);
cd = kzalloc_obj(struct genwqe_dev, GFP_KERNEL);
cd = kzalloc_obj(struct genwqe_dev);
if (!cd)
return ERR_PTR(-ENOMEM);
@@ -403,7 +403,7 @@ static int genwqe_ffdc_buffs_alloc(struct genwqe_dev *cd)
/* currently support only the debug units mentioned here */
cd->ffdc[type].entries = e;
cd->ffdc[type].regs =
kmalloc_objs(struct genwqe_reg, e, GFP_KERNEL);
kmalloc_objs(struct genwqe_reg, e);
/*
* regs == NULL is ok, the using code treats this as no regs,
* Printing warning is ok in this case.

View File

@@ -194,7 +194,7 @@ struct genwqe_ddcb_cmd *ddcb_requ_alloc(void)
{
struct ddcb_requ *req;
req = kzalloc_obj(*req, GFP_KERNEL);
req = kzalloc_obj(*req);
if (!req)
return NULL;

View File

@@ -53,7 +53,7 @@ static int curr_dbg_uidn_show(struct seq_file *s, void *unused, int uid)
if (entries == 0)
return 0;
regs = kzalloc_objs(*regs, entries, GFP_KERNEL);
regs = kzalloc_objs(*regs, entries);
if (regs == NULL)
return -ENOMEM;
@@ -122,7 +122,7 @@ static int curr_regs_show(struct seq_file *s, void *unused)
unsigned int i;
struct genwqe_reg *regs;
regs = kzalloc_objs(*regs, GENWQE_FFDC_REGS, GFP_KERNEL);
regs = kzalloc_objs(*regs, GENWQE_FFDC_REGS);
if (regs == NULL)
return -ENOMEM;

View File

@@ -301,7 +301,7 @@ static int genwqe_open(struct inode *inode, struct file *filp)
struct genwqe_dev *cd;
struct genwqe_file *cfile;
cfile = kzalloc_obj(*cfile, GFP_KERNEL);
cfile = kzalloc_obj(*cfile);
if (cfile == NULL)
return -ENOMEM;
@@ -446,7 +446,7 @@ static int genwqe_mmap(struct file *filp, struct vm_area_struct *vma)
if (get_order(vsize) > MAX_PAGE_ORDER)
return -ENOMEM;
dma_map = kzalloc_obj(struct dma_mapping, GFP_KERNEL);
dma_map = kzalloc_obj(struct dma_mapping);
if (dma_map == NULL)
return -ENOMEM;
@@ -783,7 +783,7 @@ static int genwqe_pin_mem(struct genwqe_file *cfile, struct genwqe_mem *m)
map_addr = (m->addr & PAGE_MASK);
map_size = round_up(m->size + (m->addr & ~PAGE_MASK), PAGE_SIZE);
dma_map = kzalloc_obj(struct dma_mapping, GFP_KERNEL);
dma_map = kzalloc_obj(struct dma_mapping);
if (dma_map == NULL)
return -ENOMEM;

View File

@@ -570,7 +570,7 @@ static int ilo_open(struct inode *ip, struct file *fp)
hw = container_of(ip->i_cdev, struct ilo_hwinfo, cdev);
/* new ccb allocation */
data = kzalloc_obj(*data, GFP_KERNEL);
data = kzalloc_obj(*data);
if (!data)
return -ENOMEM;
@@ -798,7 +798,7 @@ static int ilo_probe(struct pci_dev *pdev,
/* track global allocations for this device */
error = -ENOMEM;
ilo_hw = kzalloc_obj(*ilo_hw, GFP_KERNEL);
ilo_hw = kzalloc_obj(*ilo_hw);
if (!ilo_hw)
goto out;

View File

@@ -24,7 +24,7 @@ struct command *ibmasm_new_command(struct service_processor *sp, size_t buffer_s
if (buffer_size > IBMASM_CMD_MAX_BUFFER_SIZE)
return NULL;
cmd = kzalloc_obj(struct command, GFP_KERNEL);
cmd = kzalloc_obj(struct command);
if (cmd == NULL)
return NULL;

View File

@@ -139,7 +139,7 @@ int ibmasm_event_buffer_init(struct service_processor *sp)
struct ibmasm_event *event;
int i;
buffer = kmalloc_obj(struct event_buffer, GFP_KERNEL);
buffer = kmalloc_obj(struct event_buffer);
if (!buffer)
return -ENOMEM;

View File

@@ -235,7 +235,7 @@ static int command_file_open(struct inode *inode, struct file *file)
if (!inode->i_private)
return -ENODEV;
command_data = kmalloc_obj(struct ibmasmfs_command_data, GFP_KERNEL);
command_data = kmalloc_obj(struct ibmasmfs_command_data);
if (!command_data)
return -ENOMEM;
@@ -344,7 +344,7 @@ static int event_file_open(struct inode *inode, struct file *file)
sp = inode->i_private;
event_data = kmalloc_obj(struct ibmasmfs_event_data, GFP_KERNEL);
event_data = kmalloc_obj(struct ibmasmfs_event_data);
if (!event_data)
return -ENOMEM;
@@ -430,7 +430,7 @@ static int r_heartbeat_file_open(struct inode *inode, struct file *file)
if (!inode->i_private)
return -ENODEV;
rhbeat = kmalloc_obj(struct ibmasmfs_heartbeat_data, GFP_KERNEL);
rhbeat = kmalloc_obj(struct ibmasmfs_heartbeat_data);
if (!rhbeat)
return -ENOMEM;

View File

@@ -64,7 +64,7 @@ static int ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
/* vnc client won't work without bus-mastering */
pci_set_master(pdev);
sp = kzalloc_obj(struct service_processor, GFP_KERNEL);
sp = kzalloc_obj(struct service_processor);
if (sp == NULL) {
dev_err(&pdev->dev, "Failed to allocate memory\n");
result = -ENOMEM;

View File

@@ -830,7 +830,7 @@ static int ibmvmc_open(struct inode *inode, struct file *file)
(unsigned long)inode, (unsigned long)file,
ibmvmc.state);
session = kzalloc_obj(*session, GFP_KERNEL);
session = kzalloc_obj(*session);
if (!session)
return -ENOMEM;

View File

@@ -433,7 +433,7 @@ static int ics932s401_probe(struct i2c_client *client)
struct ics932s401_data *data;
int err;
data = kzalloc_obj(struct ics932s401_data, GFP_KERNEL);
data = kzalloc_obj(struct ics932s401_data);
if (!data) {
err = -ENOMEM;
goto exit;

View File

@@ -383,7 +383,7 @@ static int isl29003_probe(struct i2c_client *client)
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE))
return -EIO;
data = kzalloc_obj(struct isl29003_data, GFP_KERNEL);
data = kzalloc_obj(struct isl29003_data);
if (!data)
return -ENOMEM;

View File

@@ -335,7 +335,7 @@ static int cp500_register_i2c(struct cp500 *cp500)
{
int ret;
cp500->i2c = kzalloc_obj(*cp500->i2c, GFP_KERNEL);
cp500->i2c = kzalloc_obj(*cp500->i2c);
if (!cp500->i2c)
return -ENOMEM;
@@ -386,7 +386,7 @@ static int cp500_register_spi(struct cp500 *cp500, u8 esc_type)
int info_size;
int ret;
cp500->spi = kzalloc_obj(*cp500->spi, GFP_KERNEL);
cp500->spi = kzalloc_obj(*cp500->spi);
if (!cp500->spi)
return -ENOMEM;
@@ -443,7 +443,7 @@ static int cp500_register_fan(struct cp500 *cp500)
{
int ret;
cp500->fan = kzalloc_obj(*cp500->fan, GFP_KERNEL);
cp500->fan = kzalloc_obj(*cp500->fan);
if (!cp500->fan)
return -ENOMEM;
@@ -491,7 +491,7 @@ static int cp500_register_batt(struct cp500 *cp500)
{
int ret;
cp500->batt = kzalloc_obj(*cp500->batt, GFP_KERNEL);
cp500->batt = kzalloc_obj(*cp500->batt);
if (!cp500->batt)
return -ENOMEM;
@@ -541,7 +541,7 @@ static int cp500_register_uart(struct cp500 *cp500,
{
int ret;
*uart = kzalloc_obj(**uart, GFP_KERNEL);
*uart = kzalloc_obj(**uart);
if (!*uart)
return -ENOMEM;

View File

@@ -58,7 +58,7 @@ static struct pci_dev_intr_ctrl *pci_dev_create_intr_ctrl(struct pci_dev *pdev)
if (!fwnode)
return ERR_PTR(-ENODEV);
intr_ctrl = kmalloc_obj(*intr_ctrl, GFP_KERNEL);
intr_ctrl = kmalloc_obj(*intr_ctrl);
if (!intr_ctrl)
return ERR_PTR(-ENOMEM);

View File

@@ -952,7 +952,7 @@ int lis3lv02d_init_dt(struct lis3lv02d *lis3)
if (!lis3->of_node)
return 0;
pdata = kzalloc_obj(*pdata, GFP_KERNEL);
pdata = kzalloc_obj(*pdata);
if (!pdata)
return -ENOMEM;

View File

@@ -533,7 +533,7 @@ static void lkdtm_PTR_BOUNDS(void)
{
struct lkdtm_cb_ptr *inst;
inst = kzalloc_obj(*inst, GFP_KERNEL);
inst = kzalloc_obj(*inst);
if (!inst) {
pr_err("FAIL: could not allocate struct lkdtm_cb_ptr!\n");
return;
@@ -547,7 +547,7 @@ static void lkdtm_PTR_BOUNDS(void)
inst->len = element_count;
/* Double element_count */
inst->extra = kzalloc_objs(*inst->extra, element_count * 2, GFP_KERNEL);
inst->extra = kzalloc_objs(*inst->extra, element_count * 2);
inst->nr_extra = element_count * 2;
pr_info("Pointer access within bounds ...\n");

View File

@@ -1363,7 +1363,7 @@ static struct mei_cl_device *mei_cl_bus_dev_alloc(struct mei_device *bus,
struct mei_cl_device *cldev;
struct mei_cl *cl;
cldev = kzalloc_obj(*cldev, GFP_KERNEL);
cldev = kzalloc_obj(*cldev);
if (!cldev)
return NULL;

View File

@@ -370,7 +370,7 @@ static struct mei_cl_cb *mei_io_cb_init(struct mei_cl *cl,
{
struct mei_cl_cb *cb;
cb = kzalloc_obj(*cb, GFP_KERNEL);
cb = kzalloc_obj(*cb);
if (!cb)
return NULL;
@@ -605,7 +605,7 @@ struct mei_cl *mei_cl_allocate(struct mei_device *dev)
{
struct mei_cl *cl;
cl = kmalloc_obj(*cl, GFP_KERNEL);
cl = kmalloc_obj(*cl);
if (!cl)
return NULL;
@@ -1273,7 +1273,7 @@ struct mei_cl_vtag *mei_cl_vtag_alloc(struct file *fp, u8 vtag)
{
struct mei_cl_vtag *cl_vtag;
cl_vtag = kzalloc_obj(*cl_vtag, GFP_KERNEL);
cl_vtag = kzalloc_obj(*cl_vtag);
if (!cl_vtag)
return ERR_PTR(-ENOMEM);

View File

@@ -141,7 +141,7 @@ static int mei_gsc_proxy_probe(struct mei_cl_device *cldev,
goto enable_err_exit;
}
comp_master = kzalloc_obj(*comp_master, GFP_KERNEL);
comp_master = kzalloc_obj(*comp_master);
if (!comp_master) {
ret = -ENOMEM;
goto err_exit;

View File

@@ -409,7 +409,7 @@ static int mei_hbm_me_cl_add(struct mei_device *dev,
mei_me_cl_rm_by_uuid(dev, uuid);
me_cl = kzalloc_obj(*me_cl, GFP_KERNEL);
me_cl = kzalloc_obj(*me_cl);
if (!me_cl)
return -ENOMEM;

View File

@@ -819,7 +819,7 @@ static int mei_hdcp_probe(struct mei_cl_device *cldev,
goto enable_err_exit;
}
comp_arbiter = kzalloc_obj(*comp_arbiter, GFP_KERNEL);
comp_arbiter = kzalloc_obj(*comp_arbiter);
if (!comp_arbiter) {
ret = -ENOMEM;
goto err_exit;

View File

@@ -273,7 +273,7 @@ static int mei_pxp_probe(struct mei_cl_device *cldev,
goto enable_err_exit;
}
comp_master = kzalloc_obj(*comp_master, GFP_KERNEL);
comp_master = kzalloc_obj(*comp_master);
if (!comp_master) {
ret = -ENOMEM;
goto err_exit;

View File

@@ -721,7 +721,7 @@ int vsc_tp_init(struct vsc_tp *tp, struct device *dev)
void *rx_buf __free(kfree) = NULL;
int ret;
fw_loader = kzalloc_obj(*fw_loader, GFP_KERNEL);
fw_loader = kzalloc_obj(*fw_loader);
if (!fw_loader)
return -ENOMEM;

View File

@@ -705,7 +705,7 @@ static struct ntsync_obj *ntsync_alloc_obj(struct ntsync_device *dev,
{
struct ntsync_obj *obj;
obj = kzalloc_obj(*obj, GFP_KERNEL);
obj = kzalloc_obj(*obj);
if (!obj)
return NULL;
obj->type = type;
@@ -1145,7 +1145,7 @@ static int ntsync_char_open(struct inode *inode, struct file *file)
{
struct ntsync_device *dev;
dev = kzalloc_obj(*dev, GFP_KERNEL);
dev = kzalloc_obj(*dev);
if (!dev)
return -ENOMEM;

View File

@@ -107,7 +107,7 @@ int ocxl_afu_irq_alloc(struct ocxl_context *ctx, int *irq_id)
struct afu_irq *irq;
int rc;
irq = kzalloc_obj(struct afu_irq, GFP_KERNEL);
irq = kzalloc_obj(struct afu_irq);
if (!irq)
return -ENOMEM;

View File

@@ -10,7 +10,7 @@ int ocxl_context_alloc(struct ocxl_context **context, struct ocxl_afu *afu,
int pasid;
struct ocxl_context *ctx;
ctx = kzalloc_obj(*ctx, GFP_KERNEL);
ctx = kzalloc_obj(*ctx);
if (!ctx)
return -ENOMEM;

View File

@@ -17,7 +17,7 @@ static struct ocxl_afu *alloc_afu(struct ocxl_fn *fn)
{
struct ocxl_afu *afu;
afu = kzalloc_obj(struct ocxl_afu, GFP_KERNEL);
afu = kzalloc_obj(struct ocxl_afu);
if (!afu)
return NULL;
@@ -300,7 +300,7 @@ static struct ocxl_fn *alloc_function(void)
{
struct ocxl_fn *fn;
fn = kzalloc_obj(struct ocxl_fn, GFP_KERNEL);
fn = kzalloc_obj(struct ocxl_fn);
if (!fn)
return NULL;

View File

@@ -526,7 +526,7 @@ int ocxl_file_register_afu(struct ocxl_afu *afu)
struct ocxl_fn *fn = afu->fn;
struct pci_dev *pci_dev = to_pci_dev(fn->dev.parent);
info = kzalloc_obj(*info, GFP_KERNEL);
info = kzalloc_obj(*info);
if (info == NULL)
return -ENOMEM;

View File

@@ -345,7 +345,7 @@ static int alloc_spa(struct pci_dev *dev, struct ocxl_link *link)
{
struct spa *spa;
spa = kzalloc_obj(struct spa, GFP_KERNEL);
spa = kzalloc_obj(struct spa);
if (!spa)
return -ENOMEM;
@@ -387,7 +387,7 @@ static int alloc_link(struct pci_dev *dev, int PE_mask, struct ocxl_link **out_l
struct ocxl_link *link;
int rc;
link = kzalloc_obj(struct ocxl_link, GFP_KERNEL);
link = kzalloc_obj(struct ocxl_link);
if (!link)
return -ENOMEM;
@@ -559,7 +559,7 @@ int ocxl_link_add_pe(void *link_handle, int pasid, u32 pidr, u32 tidr,
goto unlock;
}
pe_data = kmalloc_obj(*pe_data, GFP_KERNEL);
pe_data = kmalloc_obj(*pe_data);
if (!pe_data) {
rc = -ENOMEM;
goto unlock;

View File

@@ -28,7 +28,7 @@ static int range_alloc(struct list_head *head, u32 size, int max_id,
struct id_range *cur, *new;
int rc, last_end;
new = kmalloc_obj(struct id_range, GFP_KERNEL);
new = kmalloc_obj(struct id_range);
if (!new)
return -ENOMEM;

View File

@@ -666,7 +666,7 @@ static int pch_phub_probe(struct pci_dev *pdev,
int ret;
struct pch_phub_reg *chip;
chip = kzalloc_obj(struct pch_phub_reg, GFP_KERNEL);
chip = kzalloc_obj(struct pch_phub_reg);
if (chip == NULL)
return -ENOMEM;

View File

@@ -362,7 +362,7 @@ static int phantom_probe(struct pci_dev *pdev,
}
retval = -ENOMEM;
pht = kzalloc_obj(*pht, GFP_KERNEL);
pht = kzalloc_obj(*pht);
if (pht == NULL) {
dev_err(&pdev->dev, "unable to allocate device\n");
goto err_reg;

View File

@@ -161,7 +161,7 @@ struct rpmb_dev *rpmb_dev_register(struct device *dev,
!descr->dev_id_len)
return ERR_PTR(-EINVAL);
rdev = kzalloc_obj(*rdev, GFP_KERNEL);
rdev = kzalloc_obj(*rdev);
if (!rdev)
return ERR_PTR(-ENOMEM);
rdev->descr = *descr;

View File

@@ -356,7 +356,7 @@ struct gru_vma_data *gru_alloc_vma_data(struct vm_area_struct *vma, int tsid)
{
struct gru_vma_data *vdata = NULL;
vdata = kmalloc_obj(*vdata, GFP_KERNEL);
vdata = kmalloc_obj(*vdata);
if (!vdata)
return NULL;

View File

@@ -237,7 +237,7 @@ static struct mmu_notifier *gru_alloc_notifier(struct mm_struct *mm)
{
struct gru_mm_struct *gms;
gms = kzalloc_obj(*gms, GFP_KERNEL);
gms = kzalloc_obj(*gms);
if (!gms)
return ERR_PTR(-ENOMEM);
STAT(gms_alloc);

View File

@@ -147,7 +147,7 @@ xpc_create_gru_mq_uv(unsigned int mq_size, int cpu, char *irq_name,
struct xpc_gru_mq_uv *mq;
struct uv_IO_APIC_route_entry *mmr_value;
mq = kmalloc_obj(struct xpc_gru_mq_uv, GFP_KERNEL);
mq = kmalloc_obj(struct xpc_gru_mq_uv);
if (mq == NULL) {
dev_err(xpc_part, "xpc_create_gru_mq_uv() failed to kmalloc() "
"a xpc_gru_mq_uv structure\n");
@@ -155,7 +155,7 @@ xpc_create_gru_mq_uv(unsigned int mq_size, int cpu, char *irq_name,
goto out_0;
}
mq->gru_mq_desc = kzalloc_obj(struct gru_message_queue_desc, GFP_KERNEL);
mq->gru_mq_desc = kzalloc_obj(struct gru_message_queue_desc);
if (mq->gru_mq_desc == NULL) {
dev_err(xpc_part, "xpc_create_gru_mq_uv() failed to kmalloc() "
"a gru_message_queue_desc structure\n");

View File

@@ -191,7 +191,7 @@ static int sram_reserve_regions(struct sram_dev *sram, struct resource *res)
* after the reserved blocks from the dt are processed.
*/
nblocks = (np) ? of_get_available_child_count(np) + 1 : 1;
rblocks = kzalloc_objs(*rblocks, nblocks, GFP_KERNEL);
rblocks = kzalloc_objs(*rblocks, nblocks);
if (!rblocks)
return -ENOMEM;

View File

@@ -252,7 +252,7 @@ struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm, unsigned int id,
if (!tifm_media_type_name(type, 0))
return sock;
sock = kzalloc_obj(struct tifm_dev, GFP_KERNEL);
sock = kzalloc_obj(struct tifm_dev);
if (sock) {
spin_lock_init(&sock->lock);
sock->type = type;

View File

@@ -343,7 +343,7 @@ static int tsl2550_probe(struct i2c_client *client)
goto exit;
}
data = kzalloc_obj(struct tsl2550_data, GFP_KERNEL);
data = kzalloc_obj(struct tsl2550_data);
if (!data) {
err = -ENOMEM;
goto exit;

View File

@@ -158,7 +158,7 @@ static int uacce_fops_open(struct inode *inode, struct file *filep)
if (!uacce)
return -ENODEV;
q = kzalloc_obj(struct uacce_queue, GFP_KERNEL);
q = kzalloc_obj(struct uacce_queue);
if (!q)
return -ENOMEM;
@@ -251,7 +251,7 @@ static int uacce_fops_mmap(struct file *filep, struct vm_area_struct *vma)
else
return -EINVAL;
qfr = kzalloc_obj(*qfr, GFP_KERNEL);
qfr = kzalloc_obj(*qfr);
if (!qfr)
return -ENOMEM;
@@ -506,7 +506,7 @@ struct uacce_device *uacce_alloc(struct device *parent,
struct uacce_device *uacce;
int ret;
uacce = kzalloc_obj(struct uacce_device, GFP_KERNEL);
uacce = kzalloc_obj(struct uacce_device);
if (!uacce)
return ERR_PTR(-ENOMEM);

View File

@@ -1616,7 +1616,7 @@ static int vmballoon_enable_stats(struct vmballoon *b)
if (b->stats)
goto out;
b->stats = kzalloc_obj(*b->stats, GFP_KERNEL);
b->stats = kzalloc_obj(*b->stats);
if (!b->stats) {
/* allocation failed */

View File

@@ -104,7 +104,7 @@ struct vmci_ctx *vmci_ctx_create(u32 cid, u32 priv_flags,
goto err_out;
}
context = kzalloc_obj(*context, GFP_KERNEL);
context = kzalloc_obj(*context);
if (!context) {
pr_warn("Failed to allocate memory for VMCI context\n");
error = -ENOMEM;
@@ -294,7 +294,7 @@ int vmci_ctx_enqueue_datagram(u32 cid, struct vmci_datagram *dg)
}
/* Allocate guest call entry and add it to the target VM's queue. */
dq_entry = kmalloc_obj(*dq_entry, GFP_KERNEL);
dq_entry = kmalloc_obj(*dq_entry);
if (dq_entry == NULL) {
pr_warn("Failed to allocate memory for datagram\n");
vmci_ctx_put(context);
@@ -598,7 +598,7 @@ int vmci_ctx_add_notification(u32 context_id, u32 remote_cid)
goto out;
}
notifier = kmalloc_obj(struct vmci_handle_list, GFP_KERNEL);
notifier = kmalloc_obj(struct vmci_handle_list);
if (!notifier) {
result = VMCI_ERROR_NO_MEM;
goto out;

View File

@@ -71,7 +71,7 @@ static int dg_create_handle(u32 resource_id,
handle = vmci_make_handle(context_id, resource_id);
entry = kmalloc_obj(*entry, GFP_KERNEL);
entry = kmalloc_obj(*entry);
if (!entry) {
pr_warn("Failed allocating memory for datagram entry\n");
return VMCI_ERROR_NO_MEM;

View File

@@ -402,7 +402,7 @@ int vmci_doorbell_create(struct vmci_handle *handle,
priv_flags & ~VMCI_PRIVILEGE_ALL_FLAGS)
return VMCI_ERROR_INVALID_ARGS;
entry = kmalloc_obj(*entry, GFP_KERNEL);
entry = kmalloc_obj(*entry);
if (entry == NULL) {
pr_warn("Failed allocating memory for datagram entry\n");
return VMCI_ERROR_NO_MEM;

View File

@@ -151,7 +151,7 @@ int vmci_event_subscribe(u32 event,
return VMCI_ERROR_INVALID_ARGS;
}
sub = kzalloc_obj(*sub, GFP_KERNEL);
sub = kzalloc_obj(*sub);
if (!sub)
return VMCI_ERROR_NO_MEM;

View File

@@ -120,7 +120,7 @@ static int vmci_host_open(struct inode *inode, struct file *filp)
{
struct vmci_host_dev *vmci_host_dev;
vmci_host_dev = kzalloc_obj(struct vmci_host_dev, GFP_KERNEL);
vmci_host_dev = kzalloc_obj(struct vmci_host_dev);
if (vmci_host_dev == NULL)
return -ENOMEM;

View File

@@ -895,7 +895,7 @@ qp_guest_endpoint_create(struct vmci_handle handle,
handle = vmci_make_handle(context_id, VMCI_INVALID_ID);
}
entry = kzalloc_obj(*entry, GFP_KERNEL);
entry = kzalloc_obj(*entry);
if (entry) {
entry->qp.peer = peer;
entry->qp.flags = flags;
@@ -2722,7 +2722,7 @@ int vmci_qpair_alloc(struct vmci_qp **qpair,
return VMCI_ERROR_INVALID_ARGS;
}
my_qpair = kzalloc_obj(*my_qpair, GFP_KERNEL);
my_qpair = kzalloc_obj(*my_qpair);
if (!my_qpair)
return VMCI_ERROR_NO_MEM;