[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 12 Dec 2015 15:34:50 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-scsi@...r.kernel.org, target-devel@...r.kernel.org,
"Nicholas A. Bellinger" <nab@...ux-iscsi.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 1/7] iscsi-target: Use a variable initialisation in
iscsi_set_default_param() directly
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sat, 12 Dec 2015 11:36:02 +0100
Omit the unnecessary setting to a null pointer for the variable "param"
at the beginning of the function "iscsi_set_default_param"
because it can be directly initialized with the return value
from the function "kzalloc".
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/target/iscsi/iscsi_target_parameters.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/target/iscsi/iscsi_target_parameters.c b/drivers/target/iscsi/iscsi_target_parameters.c
index 3a1f9a7..0a8bd3f 100644
--- a/drivers/target/iscsi/iscsi_target_parameters.c
+++ b/drivers/target/iscsi/iscsi_target_parameters.c
@@ -127,9 +127,8 @@ static struct iscsi_param *iscsi_set_default_param(struct iscsi_param_list *para
char *name, char *value, u8 phase, u8 scope, u8 sender,
u16 type_range, u8 use)
{
- struct iscsi_param *param = NULL;
+ struct iscsi_param *param = kzalloc(sizeof(*param), GFP_KERNEL);
- param = kzalloc(sizeof(struct iscsi_param), GFP_KERNEL);
if (!param) {
pr_err("Unable to allocate memory for parameter.\n");
goto out;
--
2.6.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists