mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-05 00:07:48 -04:00
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:
@@ -47,7 +47,7 @@ int amd_sfh_get_report(struct hid_device *hid, int report_id, int report_type)
|
||||
guard(mutex)(&mp2->lock);
|
||||
for (i = 0; i < cli_data->num_hid_devices; i++) {
|
||||
if (cli_data->hid_sensor_hubs[i] == hid) {
|
||||
struct request_list *new = kzalloc_obj(*new, GFP_KERNEL);
|
||||
struct request_list *new = kzalloc_obj(*new);
|
||||
|
||||
if (!new)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -135,7 +135,7 @@ int amdtp_hid_probe(u32 cur_hid_dev, struct amdtp_cl_data *cli_data)
|
||||
if (IS_ERR(hid))
|
||||
return PTR_ERR(hid);
|
||||
|
||||
hid_data = kzalloc_obj(*hid_data, GFP_KERNEL);
|
||||
hid_data = kzalloc_obj(*hid_data);
|
||||
if (!hid_data) {
|
||||
rc = -ENOMEM;
|
||||
goto err_hid_data;
|
||||
|
||||
@@ -320,7 +320,7 @@ hid_bpf_allocate_context(unsigned int hid_id)
|
||||
if (IS_ERR(hdev))
|
||||
return NULL;
|
||||
|
||||
ctx_kern = kzalloc_obj(*ctx_kern, GFP_KERNEL);
|
||||
ctx_kern = kzalloc_obj(*ctx_kern);
|
||||
if (!ctx_kern) {
|
||||
hid_put_device(hdev);
|
||||
return NULL;
|
||||
|
||||
@@ -794,7 +794,7 @@ static int apple_backlight_set(struct hid_device *hdev, u16 value, u16 rate)
|
||||
int ret = 0;
|
||||
struct apple_backlight_set_report *rep;
|
||||
|
||||
rep = kmalloc_obj(*rep, GFP_KERNEL);
|
||||
rep = kmalloc_obj(*rep);
|
||||
if (rep == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ static int axff_init(struct hid_device *hid)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
axff = kzalloc_obj(struct axff_device, GFP_KERNEL);
|
||||
axff = kzalloc_obj(struct axff_device);
|
||||
if (!axff)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ static int betopff_init(struct hid_device *hid)
|
||||
}
|
||||
}
|
||||
|
||||
betopff = kzalloc_obj(*betopff, GFP_KERNEL);
|
||||
betopff = kzalloc_obj(*betopff);
|
||||
if (!betopff)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ static int cmhid_probe(struct hid_device *hid, const struct hid_device_id *id)
|
||||
int ret;
|
||||
struct cmhid *cm;
|
||||
|
||||
cm = kzalloc_obj(struct cmhid, GFP_KERNEL);
|
||||
cm = kzalloc_obj(struct cmhid);
|
||||
if (!cm) {
|
||||
ret = -ENOMEM;
|
||||
goto allocfail;
|
||||
|
||||
@@ -93,7 +93,7 @@ struct hid_report *hid_register_report(struct hid_device *device,
|
||||
if (report_enum->report_id_hash[id])
|
||||
return report_enum->report_id_hash[id];
|
||||
|
||||
report = kzalloc_obj(struct hid_report, GFP_KERNEL);
|
||||
report = kzalloc_obj(struct hid_report);
|
||||
if (!report)
|
||||
return NULL;
|
||||
|
||||
@@ -1797,7 +1797,7 @@ static void hid_report_process_ordering(struct hid_device *hid,
|
||||
}
|
||||
|
||||
/* allocate the memory to process the fields */
|
||||
entries = kzalloc_objs(*entries, count, GFP_KERNEL);
|
||||
entries = kzalloc_objs(*entries, count);
|
||||
if (!entries)
|
||||
return;
|
||||
|
||||
@@ -2611,7 +2611,7 @@ static ssize_t new_id_store(struct device_driver *drv, const char *buf,
|
||||
if (ret < 3)
|
||||
return -EINVAL;
|
||||
|
||||
dynid = kzalloc_obj(*dynid, GFP_KERNEL);
|
||||
dynid = kzalloc_obj(*dynid);
|
||||
if (!dynid)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -2973,7 +2973,7 @@ struct hid_device *hid_allocate_device(void)
|
||||
struct hid_device *hdev;
|
||||
int ret = -ENOMEM;
|
||||
|
||||
hdev = kzalloc_obj(*hdev, GFP_KERNEL);
|
||||
hdev = kzalloc_obj(*hdev);
|
||||
if (hdev == NULL)
|
||||
return ERR_PTR(ret);
|
||||
|
||||
|
||||
@@ -427,7 +427,7 @@ static int k90_init_backlight(struct hid_device *dev)
|
||||
size_t name_sz;
|
||||
char *name;
|
||||
|
||||
drvdata->backlight = kzalloc_obj(struct k90_led, GFP_KERNEL);
|
||||
drvdata->backlight = kzalloc_obj(struct k90_led);
|
||||
if (!drvdata->backlight) {
|
||||
ret = -ENOMEM;
|
||||
goto fail_backlight_alloc;
|
||||
@@ -471,7 +471,7 @@ static int k90_init_macro_functions(struct hid_device *dev)
|
||||
size_t name_sz;
|
||||
char *name;
|
||||
|
||||
k90 = kzalloc_obj(struct k90_drvdata, GFP_KERNEL);
|
||||
k90 = kzalloc_obj(struct k90_drvdata);
|
||||
if (!k90) {
|
||||
ret = -ENOMEM;
|
||||
goto fail_drvdata;
|
||||
|
||||
@@ -166,7 +166,7 @@ static int cougar_bind_shared_data(struct hid_device *hdev,
|
||||
|
||||
shared = cougar_get_shared_data(hdev);
|
||||
if (!shared) {
|
||||
shared = kzalloc_obj(*shared, GFP_KERNEL);
|
||||
shared = kzalloc_obj(*shared);
|
||||
if (!shared) {
|
||||
error = -ENOMEM;
|
||||
goto out;
|
||||
|
||||
@@ -3681,7 +3681,7 @@ static int hid_debug_events_open(struct inode *inode, struct file *file)
|
||||
struct hid_debug_list *list;
|
||||
unsigned long flags;
|
||||
|
||||
if (!(list = kzalloc_obj(struct hid_debug_list, GFP_KERNEL))) {
|
||||
if (!(list = kzalloc_obj(struct hid_debug_list))) {
|
||||
err = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ static int drff_init(struct hid_device *hid)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
drff = kzalloc_obj(struct drff_device, GFP_KERNEL);
|
||||
drff = kzalloc_obj(struct drff_device);
|
||||
if (!drff)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
||||
if (!hid_is_usb(hdev))
|
||||
return -EINVAL;
|
||||
|
||||
priv = kzalloc_obj(*priv, GFP_KERNEL);
|
||||
priv = kzalloc_obj(*priv);
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ static int emsff_init(struct hid_device *hid)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
emsff = kzalloc_obj(struct emsff_device, GFP_KERNEL);
|
||||
emsff = kzalloc_obj(struct emsff_device);
|
||||
if (!emsff)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ static int gaff_init(struct hid_device *hid)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
gaff = kzalloc_obj(struct gaff_device, GFP_KERNEL);
|
||||
gaff = kzalloc_obj(struct gaff_device);
|
||||
if (!gaff)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ static int holtekff_init(struct hid_device *hid)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
holtekff = kzalloc_obj(*holtekff, GFP_KERNEL);
|
||||
holtekff = kzalloc_obj(*holtekff);
|
||||
if (!holtekff)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ static struct mousevsc_dev *mousevsc_alloc_device(struct hv_device *device)
|
||||
{
|
||||
struct mousevsc_dev *input_dev;
|
||||
|
||||
input_dev = kzalloc_obj(struct mousevsc_dev, GFP_KERNEL);
|
||||
input_dev = kzalloc_obj(struct mousevsc_dev);
|
||||
|
||||
if (!input_dev)
|
||||
return NULL;
|
||||
|
||||
@@ -531,7 +531,7 @@ static int hidinput_setup_battery(struct hid_device *dev, unsigned report_type,
|
||||
if (quirks & HID_BATTERY_QUIRK_IGNORE)
|
||||
return 0;
|
||||
|
||||
psy_desc = kzalloc_obj(*psy_desc, GFP_KERNEL);
|
||||
psy_desc = kzalloc_obj(*psy_desc);
|
||||
if (!psy_desc)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -2023,7 +2023,7 @@ static void report_features(struct hid_device *hid)
|
||||
static struct hid_input *hidinput_allocate(struct hid_device *hid,
|
||||
unsigned int application)
|
||||
{
|
||||
struct hid_input *hidinput = kzalloc_obj(*hidinput, GFP_KERNEL);
|
||||
struct hid_input *hidinput = kzalloc_obj(*hidinput);
|
||||
struct input_dev *input_dev = input_allocate_device();
|
||||
const char *suffix = NULL;
|
||||
size_t suffix_len, name_len;
|
||||
|
||||
@@ -768,7 +768,7 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
drv_data = kzalloc_obj(struct lg_drv_data, GFP_KERNEL);
|
||||
drv_data = kzalloc_obj(struct lg_drv_data);
|
||||
if (!drv_data) {
|
||||
hid_err(hdev, "Insufficient memory, cannot allocate driver data\n");
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -66,7 +66,7 @@ int lg2ff_init(struct hid_device *hid)
|
||||
if (!report)
|
||||
return -ENODEV;
|
||||
|
||||
lg2ff = kmalloc_obj(struct lg2ff_device, GFP_KERNEL);
|
||||
lg2ff = kmalloc_obj(struct lg2ff_device);
|
||||
if (!lg2ff)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -1288,7 +1288,7 @@ int lg4ff_init(struct hid_device *hid)
|
||||
hid_err(hid, "Cannot add device, private driver data not allocated\n");
|
||||
return -1;
|
||||
}
|
||||
entry = kzalloc_obj(*entry, GFP_KERNEL);
|
||||
entry = kzalloc_obj(*entry);
|
||||
if (!entry)
|
||||
return -ENOMEM;
|
||||
spin_lock_init(&entry->report_lock);
|
||||
|
||||
@@ -733,7 +733,7 @@ static struct dj_receiver_dev *dj_get_receiver_dev(struct hid_device *hdev,
|
||||
|
||||
djrcv_dev = dj_find_receiver_dev(hdev, type);
|
||||
if (!djrcv_dev) {
|
||||
djrcv_dev = kzalloc_obj(*djrcv_dev, GFP_KERNEL);
|
||||
djrcv_dev = kzalloc_obj(*djrcv_dev);
|
||||
if (!djrcv_dev)
|
||||
goto out;
|
||||
|
||||
@@ -851,7 +851,7 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev,
|
||||
snprintf(tmpstr, sizeof(tmpstr), ":%d", device_index);
|
||||
strlcat(dj_hiddev->phys, tmpstr, sizeof(dj_hiddev->phys));
|
||||
|
||||
dj_dev = kzalloc_obj(struct dj_device, GFP_KERNEL);
|
||||
dj_dev = kzalloc_obj(struct dj_device);
|
||||
|
||||
if (!dj_dev) {
|
||||
hid_err(djrcv_hdev, "%s: failed allocating dj_dev\n", __func__);
|
||||
@@ -1332,7 +1332,7 @@ static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev)
|
||||
goto out;
|
||||
}
|
||||
|
||||
dj_report = kzalloc_obj(struct dj_report, GFP_KERNEL);
|
||||
dj_report = kzalloc_obj(struct dj_report);
|
||||
if (!dj_report)
|
||||
return -ENOMEM;
|
||||
dj_report->report_id = REPORT_ID_DJ_SHORT;
|
||||
@@ -1356,7 +1356,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev,
|
||||
u8 *buf;
|
||||
int retval = 0;
|
||||
|
||||
dj_report = kzalloc_obj(struct dj_report, GFP_KERNEL);
|
||||
dj_report = kzalloc_obj(struct dj_report);
|
||||
if (!dj_report)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -390,7 +390,7 @@ static int hidpp_send_fap_command_sync(struct hidpp_device *hidpp,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
message = kzalloc_obj(struct hidpp_report, GFP_KERNEL);
|
||||
message = kzalloc_obj(struct hidpp_report);
|
||||
if (!message)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -443,7 +443,7 @@ static int hidpp_send_rap_command_sync(struct hidpp_device *hidpp_dev,
|
||||
if (param_count > max_count)
|
||||
return -EINVAL;
|
||||
|
||||
message = kzalloc_obj(struct hidpp_report, GFP_KERNEL);
|
||||
message = kzalloc_obj(struct hidpp_report);
|
||||
if (!message)
|
||||
return -ENOMEM;
|
||||
message->report_id = report_id;
|
||||
@@ -2527,7 +2527,7 @@ out:
|
||||
|
||||
static int hidpp_ff_queue_work(struct hidpp_ff_private_data *data, int effect_id, u8 command, u8 *params, u8 size)
|
||||
{
|
||||
struct hidpp_ff_work_data *wd = kzalloc_obj(*wd, GFP_KERNEL);
|
||||
struct hidpp_ff_work_data *wd = kzalloc_obj(*wd);
|
||||
int s;
|
||||
|
||||
if (!wd)
|
||||
@@ -2853,7 +2853,7 @@ static int hidpp_ff_init(struct hidpp_device *hidpp,
|
||||
data = kmemdup(data, sizeof(*data), GFP_KERNEL);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
data->effect_ids = kzalloc_objs(int, num_slots, GFP_KERNEL);
|
||||
data->effect_ids = kzalloc_objs(int, num_slots);
|
||||
if (!data->effect_ids) {
|
||||
kfree(data);
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -57,7 +57,7 @@ static int mwctrl_init(struct hid_device *hid)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
mwctrl = kzalloc_obj(struct mwctrl_device, GFP_KERNEL);
|
||||
mwctrl = kzalloc_obj(struct mwctrl_device);
|
||||
if (!mwctrl)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ static int mf_init(struct hid_device *hid)
|
||||
input_ptr = input_ptr->next;
|
||||
input = list_entry(input_ptr, struct hid_input, list);
|
||||
|
||||
mf = kzalloc_obj(struct mf_device, GFP_KERNEL);
|
||||
mf = kzalloc_obj(struct mf_device);
|
||||
if (!mf)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -900,7 +900,7 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
||||
hdev->quirks |= HID_QUIRK_MULTI_INPUT
|
||||
| HID_QUIRK_NO_INIT_REPORTS;
|
||||
|
||||
nd = kmalloc_obj(struct ntrig_data, GFP_KERNEL);
|
||||
nd = kmalloc_obj(struct ntrig_data);
|
||||
if (!nd) {
|
||||
hid_err(hdev, "cannot allocate N-Trig data\n");
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -78,7 +78,7 @@ struct picolcd_pending *picolcd_send_and_wait(struct hid_device *hdev,
|
||||
return NULL;
|
||||
if (data->status & PICOLCD_FAILED)
|
||||
return NULL;
|
||||
work = kzalloc_obj(*work, GFP_KERNEL);
|
||||
work = kzalloc_obj(*work);
|
||||
if (!work)
|
||||
return NULL;
|
||||
|
||||
@@ -528,7 +528,7 @@ static int picolcd_probe(struct hid_device *hdev,
|
||||
* Let's allocate the picolcd data structure, set some reasonable
|
||||
* defaults, and associate it with the device
|
||||
*/
|
||||
data = kzalloc_obj(struct picolcd_data, GFP_KERNEL);
|
||||
data = kzalloc_obj(struct picolcd_data);
|
||||
if (data == NULL) {
|
||||
hid_err(hdev, "can't allocate space for Minibox PicoLCD device data\n");
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -140,7 +140,7 @@ static int plff_init(struct hid_device *hid)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
plff = kzalloc_obj(struct plff_device, GFP_KERNEL);
|
||||
plff = kzalloc_obj(struct plff_device);
|
||||
if (!plff)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -1658,7 +1658,7 @@ static int dualsense_reset_leds(struct dualsense *ds)
|
||||
struct dualsense_output_report report;
|
||||
struct dualsense_output_report_bt *buf;
|
||||
|
||||
buf = kzalloc_obj(*buf, GFP_KERNEL);
|
||||
buf = kzalloc_obj(*buf);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -797,7 +797,7 @@ static int pk_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
||||
intf = to_usb_interface(hdev->dev.parent);
|
||||
ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
|
||||
|
||||
pm = kzalloc_obj(*pm, GFP_KERNEL);
|
||||
pm = kzalloc_obj(*pm);
|
||||
if (pm == NULL) {
|
||||
hid_err(hdev, "can't alloc descriptor\n");
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1164,11 +1164,11 @@ static int hid_modify_dquirk(const struct hid_device_id *id,
|
||||
int list_edited = 0;
|
||||
int ret = 0;
|
||||
|
||||
hdev = kzalloc_obj(*hdev, GFP_KERNEL);
|
||||
hdev = kzalloc_obj(*hdev);
|
||||
if (!hdev)
|
||||
return -ENOMEM;
|
||||
|
||||
q_new = kmalloc_obj(struct quirks_list_struct, GFP_KERNEL);
|
||||
q_new = kmalloc_obj(struct quirks_list_struct);
|
||||
if (!q_new) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
|
||||
@@ -299,7 +299,7 @@ static int arvo_init_specials(struct hid_device *hdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
arvo = kzalloc_obj(*arvo, GFP_KERNEL);
|
||||
arvo = kzalloc_obj(*arvo);
|
||||
if (!arvo) {
|
||||
hid_err(hdev, "can't alloc device descriptor\n");
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -279,7 +279,7 @@ static int isku_init_specials(struct hid_device *hdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
isku = kzalloc_obj(*isku, GFP_KERNEL);
|
||||
isku = kzalloc_obj(*isku);
|
||||
if (!isku) {
|
||||
hid_err(hdev, "can't alloc device descriptor\n");
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -704,7 +704,7 @@ static int kone_init_specials(struct hid_device *hdev)
|
||||
if (intf->cur_altsetting->desc.bInterfaceProtocol
|
||||
== USB_INTERFACE_PROTOCOL_MOUSE) {
|
||||
|
||||
kone = kzalloc_obj(*kone, GFP_KERNEL);
|
||||
kone = kzalloc_obj(*kone);
|
||||
if (!kone)
|
||||
return -ENOMEM;
|
||||
hid_set_drvdata(hdev, kone);
|
||||
|
||||
@@ -384,7 +384,7 @@ static int koneplus_init_specials(struct hid_device *hdev)
|
||||
if (intf->cur_altsetting->desc.bInterfaceProtocol
|
||||
== USB_INTERFACE_PROTOCOL_MOUSE) {
|
||||
|
||||
koneplus = kzalloc_obj(*koneplus, GFP_KERNEL);
|
||||
koneplus = kzalloc_obj(*koneplus);
|
||||
if (!koneplus) {
|
||||
hid_err(hdev, "can't alloc device descriptor\n");
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -88,7 +88,7 @@ static int konepure_init_specials(struct hid_device *hdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
konepure = kzalloc_obj(*konepure, GFP_KERNEL);
|
||||
konepure = kzalloc_obj(*konepure);
|
||||
if (!konepure) {
|
||||
hid_err(hdev, "can't alloc device descriptor\n");
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -453,7 +453,7 @@ static int kovaplus_init_specials(struct hid_device *hdev)
|
||||
if (intf->cur_altsetting->desc.bInterfaceProtocol
|
||||
== USB_INTERFACE_PROTOCOL_MOUSE) {
|
||||
|
||||
kovaplus = kzalloc_obj(*kovaplus, GFP_KERNEL);
|
||||
kovaplus = kzalloc_obj(*kovaplus);
|
||||
if (!kovaplus) {
|
||||
hid_err(hdev, "can't alloc device descriptor\n");
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -119,7 +119,7 @@ static int lua_init_specials(struct hid_device *hdev)
|
||||
struct lua_device *lua;
|
||||
int retval;
|
||||
|
||||
lua = kzalloc_obj(*lua, GFP_KERNEL);
|
||||
lua = kzalloc_obj(*lua);
|
||||
if (!lua) {
|
||||
hid_err(hdev, "can't alloc device descriptor\n");
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -403,7 +403,7 @@ static int pyra_init_specials(struct hid_device *hdev)
|
||||
if (intf->cur_altsetting->desc.bInterfaceProtocol
|
||||
== USB_INTERFACE_PROTOCOL_MOUSE) {
|
||||
|
||||
pyra = kzalloc_obj(*pyra, GFP_KERNEL);
|
||||
pyra = kzalloc_obj(*pyra);
|
||||
if (!pyra) {
|
||||
hid_err(hdev, "can't alloc device descriptor\n");
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -96,7 +96,7 @@ static int ryos_init_specials(struct hid_device *hdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
ryos = kzalloc_obj(*ryos, GFP_KERNEL);
|
||||
ryos = kzalloc_obj(*ryos);
|
||||
if (!ryos) {
|
||||
hid_err(hdev, "can't alloc device descriptor\n");
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -68,7 +68,7 @@ static int savu_init_specials(struct hid_device *hdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
savu = kzalloc_obj(*savu, GFP_KERNEL);
|
||||
savu = kzalloc_obj(*savu);
|
||||
if (!savu) {
|
||||
hid_err(hdev, "can't alloc device descriptor\n");
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -152,7 +152,7 @@ static int roccat_open(struct inode *inode, struct file *file)
|
||||
struct roccat_device *device;
|
||||
int error = 0;
|
||||
|
||||
reader = kzalloc_obj(struct roccat_reader, GFP_KERNEL);
|
||||
reader = kzalloc_obj(struct roccat_reader);
|
||||
if (!reader)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -301,7 +301,7 @@ int roccat_connect(const struct class *klass, struct hid_device *hid, int report
|
||||
struct roccat_device *device;
|
||||
int temp;
|
||||
|
||||
device = kzalloc_obj(struct roccat_device, GFP_KERNEL);
|
||||
device = kzalloc_obj(struct roccat_device);
|
||||
if (!device)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -912,7 +912,7 @@ hid_sensor_custom_get_known(struct hid_sensor_hub_device *hsdev,
|
||||
hid_sensor_custom_known_table;
|
||||
struct hid_sensor_custom_properties *prop;
|
||||
|
||||
prop = kmalloc_obj(struct hid_sensor_custom_properties, GFP_KERNEL);
|
||||
prop = kmalloc_obj(struct hid_sensor_custom_properties);
|
||||
if (!prop)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ static int sjoyff_init(struct hid_device *hid)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
sjoyff = kzalloc_obj(struct sjoyff_device, GFP_KERNEL);
|
||||
sjoyff = kzalloc_obj(struct sjoyff_device);
|
||||
if (!sjoyff)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -308,7 +308,7 @@ static int thrustmaster_probe(struct hid_device *hdev, const struct hid_device_i
|
||||
}
|
||||
|
||||
// Now we allocate the tm_wheel
|
||||
tm_wheel = kzalloc_obj(struct tm_wheel, GFP_KERNEL);
|
||||
tm_wheel = kzalloc_obj(struct tm_wheel);
|
||||
if (!tm_wheel) {
|
||||
ret = -ENOMEM;
|
||||
goto error1;
|
||||
@@ -328,7 +328,7 @@ static int thrustmaster_probe(struct hid_device *hdev, const struct hid_device_i
|
||||
goto error3;
|
||||
}
|
||||
|
||||
tm_wheel->response = kzalloc_obj(struct tm_wheel_response, GFP_KERNEL);
|
||||
tm_wheel->response = kzalloc_obj(struct tm_wheel_response);
|
||||
if (!tm_wheel->response) {
|
||||
ret = -ENOMEM;
|
||||
goto error4;
|
||||
|
||||
@@ -132,7 +132,7 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits)
|
||||
hidinput = list_entry(hid->inputs.next, struct hid_input, list);
|
||||
input_dev = hidinput->input;
|
||||
|
||||
tmff = kzalloc_obj(struct tmff_device, GFP_KERNEL);
|
||||
tmff = kzalloc_obj(struct tmff_device);
|
||||
if (!tmff)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -1358,13 +1358,13 @@ static int uclogic_params_ugee_v2_init_event_hooks(struct hid_device *hdev,
|
||||
if (!uclogic_params_ugee_v2_has_battery(hdev))
|
||||
return 0;
|
||||
|
||||
p->event_hooks = kzalloc_obj(*p->event_hooks, GFP_KERNEL);
|
||||
p->event_hooks = kzalloc_obj(*p->event_hooks);
|
||||
if (!p->event_hooks)
|
||||
return -ENOMEM;
|
||||
|
||||
INIT_LIST_HEAD(&p->event_hooks->list);
|
||||
|
||||
event_hook = kzalloc_obj(*event_hook, GFP_KERNEL);
|
||||
event_hook = kzalloc_obj(*event_hook);
|
||||
if (!event_hook)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -1737,7 +1737,7 @@ static struct wiimote_data *wiimote_create(struct hid_device *hdev)
|
||||
{
|
||||
struct wiimote_data *wdata;
|
||||
|
||||
wdata = kzalloc_obj(*wdata, GFP_KERNEL);
|
||||
wdata = kzalloc_obj(*wdata);
|
||||
if (!wdata)
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ int wiidebug_init(struct wiimote_data *wdata)
|
||||
struct wiimote_debug *dbg;
|
||||
unsigned long flags;
|
||||
|
||||
dbg = kzalloc_obj(*dbg, GFP_KERNEL);
|
||||
dbg = kzalloc_obj(*dbg);
|
||||
if (!dbg)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ static int zpff_init(struct hid_device *hid)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
zpff = kzalloc_obj(struct zpff_device, GFP_KERNEL);
|
||||
zpff = kzalloc_obj(struct zpff_device);
|
||||
if (!zpff)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -281,7 +281,7 @@ static int hidraw_open(struct inode *inode, struct file *file)
|
||||
unsigned long flags;
|
||||
int err = 0;
|
||||
|
||||
if (!(list = kzalloc_obj(struct hidraw_list, GFP_KERNEL))) {
|
||||
if (!(list = kzalloc_obj(struct hidraw_list))) {
|
||||
err = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
@@ -603,7 +603,7 @@ int hidraw_connect(struct hid_device *hid)
|
||||
|
||||
/* we accept any HID device, all applications */
|
||||
|
||||
dev = kzalloc_obj(struct hidraw, GFP_KERNEL);
|
||||
dev = kzalloc_obj(struct hidraw);
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ int ishtp_hid_probe(unsigned int cur_hid_dev,
|
||||
if (IS_ERR(hid))
|
||||
return PTR_ERR(hid);
|
||||
|
||||
hid_data = kzalloc_obj(*hid_data, GFP_KERNEL);
|
||||
hid_data = kzalloc_obj(*hid_data);
|
||||
if (!hid_data) {
|
||||
rv = -ENOMEM;
|
||||
goto err_hid_data;
|
||||
|
||||
@@ -435,7 +435,7 @@ static struct ishtp_cl_device *ishtp_bus_add_device(struct ishtp_device *dev,
|
||||
}
|
||||
spin_unlock_irqrestore(&dev->device_list_lock, flags);
|
||||
|
||||
device = kzalloc_obj(struct ishtp_cl_device, GFP_KERNEL);
|
||||
device = kzalloc_obj(struct ishtp_cl_device);
|
||||
if (!device)
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ int ishtp_cl_alloc_tx_ring(struct ishtp_cl *cl)
|
||||
for (j = 0; j < cl->tx_ring_size; ++j) {
|
||||
struct ishtp_cl_tx_ring *tx_buf;
|
||||
|
||||
tx_buf = kzalloc_obj(struct ishtp_cl_tx_ring, GFP_KERNEL);
|
||||
tx_buf = kzalloc_obj(struct ishtp_cl_tx_ring);
|
||||
if (!tx_buf)
|
||||
goto out;
|
||||
|
||||
@@ -183,7 +183,7 @@ struct ishtp_cl_rb *ishtp_io_rb_init(struct ishtp_cl *cl)
|
||||
{
|
||||
struct ishtp_cl_rb *rb;
|
||||
|
||||
rb = kzalloc_obj(struct ishtp_cl_rb, GFP_KERNEL);
|
||||
rb = kzalloc_obj(struct ishtp_cl_rb);
|
||||
if (!rb)
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ struct ishtp_cl *ishtp_cl_allocate(struct ishtp_cl_device *cl_device)
|
||||
{
|
||||
struct ishtp_cl *cl;
|
||||
|
||||
cl = kmalloc_obj(struct ishtp_cl, GFP_KERNEL);
|
||||
cl = kmalloc_obj(struct ishtp_cl);
|
||||
if (!cl)
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ static int uhid_queue_event(struct uhid_device *uhid, __u32 event)
|
||||
unsigned long flags;
|
||||
struct uhid_event *ev;
|
||||
|
||||
ev = kzalloc_obj(*ev, GFP_KERNEL);
|
||||
ev = kzalloc_obj(*ev);
|
||||
if (!ev)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -129,7 +129,7 @@ static int uhid_hid_start(struct hid_device *hid)
|
||||
struct uhid_event *ev;
|
||||
unsigned long flags;
|
||||
|
||||
ev = kzalloc_obj(*ev, GFP_KERNEL);
|
||||
ev = kzalloc_obj(*ev);
|
||||
if (!ev)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -240,7 +240,7 @@ static int uhid_hid_get_report(struct hid_device *hid, unsigned char rnum,
|
||||
if (!READ_ONCE(uhid->running))
|
||||
return -EIO;
|
||||
|
||||
ev = kzalloc_obj(*ev, GFP_KERNEL);
|
||||
ev = kzalloc_obj(*ev);
|
||||
if (!ev)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -282,7 +282,7 @@ static int uhid_hid_set_report(struct hid_device *hid, unsigned char rnum,
|
||||
if (!READ_ONCE(uhid->running) || count > UHID_DATA_MAX)
|
||||
return -EIO;
|
||||
|
||||
ev = kzalloc_obj(*ev, GFP_KERNEL);
|
||||
ev = kzalloc_obj(*ev);
|
||||
if (!ev)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -365,7 +365,7 @@ static int uhid_hid_output_raw(struct hid_device *hid, __u8 *buf, size_t count,
|
||||
if (count < 1 || count > UHID_DATA_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
ev = kzalloc_obj(*ev, GFP_KERNEL);
|
||||
ev = kzalloc_obj(*ev);
|
||||
if (!ev)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -433,7 +433,7 @@ static int uhid_event_from_user(const char __user *buffer, size_t len,
|
||||
*/
|
||||
struct uhid_create_req_compat *compat;
|
||||
|
||||
compat = kzalloc_obj(*compat, GFP_KERNEL);
|
||||
compat = kzalloc_obj(*compat);
|
||||
if (!compat)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -636,7 +636,7 @@ static int uhid_char_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct uhid_device *uhid;
|
||||
|
||||
uhid = kzalloc_obj(*uhid, GFP_KERNEL);
|
||||
uhid = kzalloc_obj(*uhid);
|
||||
if (!uhid)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -858,7 +858,7 @@ static int hid_alloc_buffers(struct usb_device *dev, struct hid_device *hid)
|
||||
&usbhid->inbuf_dma);
|
||||
usbhid->outbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
|
||||
&usbhid->outbuf_dma);
|
||||
usbhid->cr = kmalloc_obj(*usbhid->cr, GFP_KERNEL);
|
||||
usbhid->cr = kmalloc_obj(*usbhid->cr);
|
||||
usbhid->ctrlbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL,
|
||||
&usbhid->ctrlbuf_dma);
|
||||
if (!usbhid->inbuf || !usbhid->outbuf || !usbhid->cr ||
|
||||
@@ -1430,7 +1430,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *
|
||||
if (usb_string(dev, dev->descriptor.iSerialNumber, hid->uniq, 64) <= 0)
|
||||
hid->uniq[0] = 0;
|
||||
|
||||
usbhid = kzalloc_obj(*usbhid, GFP_KERNEL);
|
||||
usbhid = kzalloc_obj(*usbhid);
|
||||
if (usbhid == NULL) {
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
|
||||
@@ -1528,7 +1528,7 @@ int hid_pidff_init_with_quirks(struct hid_device *hid, u32 initial_quirks)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
pidff = kzalloc_obj(*pidff, GFP_KERNEL);
|
||||
pidff = kzalloc_obj(*pidff);
|
||||
if (!pidff)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -434,7 +434,7 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
|
||||
struct hid_field *field;
|
||||
int i;
|
||||
|
||||
uref_multi = kmalloc_obj(struct hiddev_usage_ref_multi, GFP_KERNEL);
|
||||
uref_multi = kmalloc_obj(struct hiddev_usage_ref_multi);
|
||||
if (!uref_multi)
|
||||
return -ENOMEM;
|
||||
uref = &uref_multi->uref;
|
||||
@@ -890,7 +890,7 @@ int hiddev_connect(struct hid_device *hid, unsigned int force)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!(hiddev = kzalloc_obj(struct hiddev, GFP_KERNEL)))
|
||||
if (!(hiddev = kzalloc_obj(struct hiddev)))
|
||||
return -ENOMEM;
|
||||
|
||||
init_waitqueue_head(&hiddev->wait);
|
||||
|
||||
@@ -241,7 +241,7 @@ static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd)
|
||||
return -1;
|
||||
if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_KERNEL, &kbd->new_dma)))
|
||||
return -1;
|
||||
if (!(kbd->cr = kmalloc_obj(struct usb_ctrlrequest, GFP_KERNEL)))
|
||||
if (!(kbd->cr = kmalloc_obj(struct usb_ctrlrequest)))
|
||||
return -1;
|
||||
if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_KERNEL, &kbd->leds_dma)))
|
||||
return -1;
|
||||
@@ -281,7 +281,7 @@ static int usb_kbd_probe(struct usb_interface *iface,
|
||||
pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
|
||||
maxp = usb_maxpacket(dev, pipe);
|
||||
|
||||
kbd = kzalloc_obj(struct usb_kbd, GFP_KERNEL);
|
||||
kbd = kzalloc_obj(struct usb_kbd);
|
||||
input_dev = input_allocate_device();
|
||||
if (!kbd || !input_dev)
|
||||
goto fail1;
|
||||
|
||||
@@ -125,7 +125,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
|
||||
pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
|
||||
maxp = usb_maxpacket(dev, pipe);
|
||||
|
||||
mouse = kzalloc_obj(struct usb_mouse, GFP_KERNEL);
|
||||
mouse = kzalloc_obj(struct usb_mouse);
|
||||
input_dev = input_allocate_device();
|
||||
if (!mouse || !input_dev)
|
||||
goto fail1;
|
||||
|
||||
@@ -892,7 +892,7 @@ static int wacom_add_shared_data(struct hid_device *hdev)
|
||||
|
||||
data = wacom_get_hdev_data(hdev);
|
||||
if (!data) {
|
||||
data = kzalloc_obj(struct wacom_hdev_data, GFP_KERNEL);
|
||||
data = kzalloc_obj(struct wacom_hdev_data);
|
||||
if (!data) {
|
||||
mutex_unlock(&wacom_udev_list_lock);
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user