Skip to content

Commit

Permalink
[S390] zcrypt: Free ap_device if dev_set_name fails.
Browse files Browse the repository at this point in the history
If dev_set_name fails during scanning the AP bus, the reserved memory
has to be freed.

Signed-off-by: Felix Beck <felix.beck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Felix Beck authored and Martin Schwidefsky committed Sep 11, 2009
1 parent 95f1556 commit edc44fa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/s390/crypto/ap_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit edc44fa

Please sign in to comment.