提交 edc44fa0 编写于 作者: F Felix Beck 提交者: Martin Schwidefsky

[S390] zcrypt: Free ap_device if dev_set_name fails.

If dev_set_name fails during scanning the AP bus, the reserved memory
has to be freed.
Signed-off-by: NFelix Beck <felix.beck@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 95f1556c
......@@ -1111,8 +1111,11 @@ static void ap_scan_bus(struct work_struct *unused)
ap_dev->device.bus = &ap_bus_type;
ap_dev->device.parent = ap_root_device;
dev_set_name(&ap_dev->device, "card%02x",
AP_QID_DEVICE(ap_dev->qid));
if (dev_set_name(&ap_dev->device, "card%02x",
AP_QID_DEVICE(ap_dev->qid))) {
kfree(ap_dev);
continue;
}
ap_dev->device.release = ap_device_release;
rc = device_register(&ap_dev->device);
if (rc) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册