aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_fc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_fc.c')
-rw-r--r--drivers/s390/scsi/zfcp_fc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c
index 6d5ccc053e3a..ac5e3b7a3576 100644
--- a/drivers/s390/scsi/zfcp_fc.c
+++ b/drivers/s390/scsi/zfcp_fc.c
@@ -389,15 +389,16 @@ static void zfcp_fc_adisc_handler(void *data)
389 out: 389 out:
390 atomic_clear_mask(ZFCP_STATUS_PORT_LINK_TEST, &port->status); 390 atomic_clear_mask(ZFCP_STATUS_PORT_LINK_TEST, &port->status);
391 put_device(&port->sysfs_device); 391 put_device(&port->sysfs_device);
392 kfree(adisc); 392 kmem_cache_free(zfcp_data.adisc_cache, adisc);
393} 393}
394 394
395static int zfcp_fc_adisc(struct zfcp_port *port) 395static int zfcp_fc_adisc(struct zfcp_port *port)
396{ 396{
397 struct zfcp_fc_els_adisc *adisc; 397 struct zfcp_fc_els_adisc *adisc;
398 struct zfcp_adapter *adapter = port->adapter; 398 struct zfcp_adapter *adapter = port->adapter;
399 int ret;
399 400
400 adisc = kzalloc(sizeof(struct zfcp_fc_els_adisc), GFP_ATOMIC); 401 adisc = kmem_cache_alloc(zfcp_data.adisc_cache, GFP_ATOMIC);
401 if (!adisc) 402 if (!adisc)
402 return -ENOMEM; 403 return -ENOMEM;
403 404
@@ -420,7 +421,11 @@ static int zfcp_fc_adisc(struct zfcp_port *port)
420 hton24(adisc->adisc_req.adisc_port_id, 421 hton24(adisc->adisc_req.adisc_port_id,
421 fc_host_port_id(adapter->scsi_host)); 422 fc_host_port_id(adapter->scsi_host));
422 423
423 return zfcp_fsf_send_els(adapter, port->d_id, &adisc->els); 424 ret = zfcp_fsf_send_els(adapter, port->d_id, &adisc->els);
425 if (ret)
426 kmem_cache_free(zfcp_data.adisc_cache, adisc);
427
428 return ret;
424} 429}
425 430
426void zfcp_fc_link_test_work(struct work_struct *work) 431void zfcp_fc_link_test_work(struct work_struct *work)