Loading drivers/hid/hid-input.c +10 −4 Original line number Original line Diff line number Diff line Loading @@ -1516,6 +1516,7 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid, struct hid_input *hidinput = kzalloc(sizeof(*hidinput), GFP_KERNEL); struct hid_input *hidinput = kzalloc(sizeof(*hidinput), GFP_KERNEL); struct input_dev *input_dev = input_allocate_device(); struct input_dev *input_dev = input_allocate_device(); const char *suffix = NULL; const char *suffix = NULL; size_t suffix_len, name_len; if (!hidinput || !input_dev) if (!hidinput || !input_dev) goto fail; goto fail; Loading Loading @@ -1559,11 +1560,16 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid, } } if (suffix) { if (suffix) { name_len = strlen(hid->name); suffix_len = strlen(suffix); if ((name_len < suffix_len) || strcmp(hid->name + name_len - suffix_len, suffix)) { hidinput->name = kasprintf(GFP_KERNEL, "%s %s", hidinput->name = kasprintf(GFP_KERNEL, "%s %s", hid->name, suffix); hid->name, suffix); if (!hidinput->name) if (!hidinput->name) goto fail; goto fail; } } } input_set_drvdata(input_dev, hid); input_set_drvdata(input_dev, hid); input_dev->event = hidinput_input_event; input_dev->event = hidinput_input_event; Loading Loading
drivers/hid/hid-input.c +10 −4 Original line number Original line Diff line number Diff line Loading @@ -1516,6 +1516,7 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid, struct hid_input *hidinput = kzalloc(sizeof(*hidinput), GFP_KERNEL); struct hid_input *hidinput = kzalloc(sizeof(*hidinput), GFP_KERNEL); struct input_dev *input_dev = input_allocate_device(); struct input_dev *input_dev = input_allocate_device(); const char *suffix = NULL; const char *suffix = NULL; size_t suffix_len, name_len; if (!hidinput || !input_dev) if (!hidinput || !input_dev) goto fail; goto fail; Loading Loading @@ -1559,11 +1560,16 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid, } } if (suffix) { if (suffix) { name_len = strlen(hid->name); suffix_len = strlen(suffix); if ((name_len < suffix_len) || strcmp(hid->name + name_len - suffix_len, suffix)) { hidinput->name = kasprintf(GFP_KERNEL, "%s %s", hidinput->name = kasprintf(GFP_KERNEL, "%s %s", hid->name, suffix); hid->name, suffix); if (!hidinput->name) if (!hidinput->name) goto fail; goto fail; } } } input_set_drvdata(input_dev, hid); input_set_drvdata(input_dev, hid); input_dev->event = hidinput_input_event; input_dev->event = hidinput_input_event; Loading