Displaying 4 results from an estimated 4 matches for "vhost_scsi_make_tport".
2017 May 20
4
[PATCH 0/2] vhost/scsi: Adjustments for five function implementations
From: Markus Elfring <elfring at users.sourceforge.net>
Date: Sat, 20 May 2017 16:25:04 +0200
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (2):
Improve a size determination in four functions
Delete error messages for failed memory allocations in five functions
drivers/vhost/scsi.c | 33 +++++++++++----------------------
1 file
2017 May 20
4
[PATCH 0/2] vhost/scsi: Adjustments for five function implementations
From: Markus Elfring <elfring at users.sourceforge.net>
Date: Sat, 20 May 2017 16:25:04 +0200
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (2):
Improve a size determination in four functions
Delete error messages for failed memory allocations in five functions
drivers/vhost/scsi.c | 33 +++++++++++----------------------
1 file
2017 May 20
0
[PATCH 1/2] vhost/scsi: Improve a size determination in four functions
...5 +1957,5 @@ vhost_scsi_make_tpg(struct se_wwn *wwn,
if (kstrtou16(name + 5, 10, &tpgt) || tpgt >= VHOST_SCSI_MAX_TARGET)
return ERR_PTR(-EINVAL);
- tpg = kzalloc(sizeof(struct vhost_scsi_tpg), GFP_KERNEL);
+ tpg = kzalloc(sizeof(*tpg), GFP_KERNEL);
if (!tpg) {
@@ -2012,5 +2011,5 @@ vhost_scsi_make_tport(struct target_fabric_configfs *tf,
/* if (vhost_scsi_parse_wwn(name, &wwpn, 1) < 0)
return ERR_PTR(-EINVAL); */
- tport = kzalloc(sizeof(struct vhost_scsi_tport), GFP_KERNEL);
+ tport = kzalloc(sizeof(*tport), GFP_KERNEL);
if (!tport) {
--
2.13.0
2017 May 20
0
[PATCH 2/2] vhost/scsi: Delete error messages for failed memory allocations in five functions
...@@ vhost_scsi_make_tpg(struct se_wwn *wwn,
- if (!tpg) {
- pr_err("Unable to allocate struct vhost_scsi_tpg");
+ if (!tpg)
return ERR_PTR(-ENOMEM);
- }
+
mutex_init(&tpg->tv_tpg_mutex);
INIT_LIST_HEAD(&tpg->tv_tpg_list);
tpg->tport = tport;
@@ -2015,7 +2006,6 @@ vhost_scsi_make_tport(struct target_fabric_configfs *tf,
- if (!tport) {
- pr_err("Unable to allocate struct vhost_scsi_tport");
+ if (!tport)
return ERR_PTR(-ENOMEM);
- }
+
tport->tport_wwpn = wwpn;
/*
* Determine the emulated Protocol Identifier and Target Port Name
--
2.13.0