diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index dfb2548e00529cc14ca60e5188cb13b91b481ce7..0f8cb441190bd9da6063ef6c90ceabc7fc6c37bc 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -1514,7 +1514,6 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app) static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi) { struct mt_device *td = hid_get_drvdata(hdev); - char *name; const char *suffix = NULL; unsigned int application = 0; struct mt_report_data *rdata; @@ -1580,15 +1579,9 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi) } } - if (suffix) { - name = devm_kzalloc(&hi->input->dev, - strlen(hdev->name) + strlen(suffix) + 2, - GFP_KERNEL); - if (name) { - sprintf(name, "%s %s", hdev->name, suffix); - hi->input->name = name; - } - } + if (suffix) + hi->input->name = devm_kasprintf(&hdev->dev, GFP_KERNEL, + "%s %s", hdev->name, suffix); return 0; }