diff options
author | Felix Beck <felix.beck@de.ibm.com> | 2009-09-11 04:28:52 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-09-11 04:29:51 -0400 |
commit | edc44fa03ed7bc9847787e080190cf1d7ed68ceb (patch) | |
tree | 78b6b02e04c0edd32d123cf7ab78b333660f5d90 /drivers/s390/crypto/ap_bus.c | |
parent | 95f1556c35529a162cef50296f3dc7f978852048 (diff) |
[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: Felix Beck <felix.beck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/crypto/ap_bus.c')
-rw-r--r-- | drivers/s390/crypto/ap_bus.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index 85785807acbc..090b32a339c6 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c | |||
@@ -1111,8 +1111,11 @@ static void ap_scan_bus(struct work_struct *unused) | |||
1111 | 1111 | ||
1112 | ap_dev->device.bus = &ap_bus_type; | 1112 | ap_dev->device.bus = &ap_bus_type; |
1113 | ap_dev->device.parent = ap_root_device; | 1113 | ap_dev->device.parent = ap_root_device; |
1114 | dev_set_name(&ap_dev->device, "card%02x", | 1114 | if (dev_set_name(&ap_dev->device, "card%02x", |
1115 | AP_QID_DEVICE(ap_dev->qid)); | 1115 | AP_QID_DEVICE(ap_dev->qid))) { |
1116 | kfree(ap_dev); | ||
1117 | continue; | ||
1118 | } | ||
1116 | ap_dev->device.release = ap_device_release; | 1119 | ap_dev->device.release = ap_device_release; |
1117 | rc = device_register(&ap_dev->device); | 1120 | rc = device_register(&ap_dev->device); |
1118 | if (rc) { | 1121 | if (rc) { |