mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-17 12:46:27 +00:00
scst: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Linux kernel Coccinelle script from scripts/coccinelle/api/kmalloc_objs.cocci against the SCST tree. This patch doesn't change any functionality.
This commit is contained in:
+1
-1
@@ -559,7 +559,7 @@ static void ft_recv_cmd(struct ft_sess *sess, struct fc_frame *fp)
|
||||
if (!sp)
|
||||
goto busy;
|
||||
|
||||
fcmd = kzalloc(sizeof(*fcmd), GFP_ATOMIC);
|
||||
fcmd = kzalloc_obj(*fcmd, GFP_ATOMIC);
|
||||
if (!fcmd)
|
||||
goto busy;
|
||||
fcmd->max_payload = sess->max_payload;
|
||||
|
||||
+3
-3
@@ -56,7 +56,7 @@ static struct ft_tport *ft_tport_create(struct fc_lport *lport)
|
||||
return tport;
|
||||
}
|
||||
|
||||
tport = kzalloc(sizeof(*tport), GFP_KERNEL);
|
||||
tport = kzalloc_obj(*tport);
|
||||
if (!tport) {
|
||||
FT_SESS_DBG("tport alloc %s failed\n", name);
|
||||
return NULL;
|
||||
@@ -214,7 +214,7 @@ static int ft_sess_create(struct ft_tport *tport, struct fc_rport_priv *rdata,
|
||||
}
|
||||
}
|
||||
|
||||
sess = kzalloc(sizeof(*sess), GFP_KERNEL);
|
||||
sess = kzalloc_obj(*sess);
|
||||
if (!sess)
|
||||
return FC_SPP_RESP_RES; /* out of resources */
|
||||
|
||||
@@ -316,7 +316,7 @@ int ft_get_transport_id(struct scst_tgt *tgt, struct scst_session *scst_sess, ui
|
||||
if (!scst_sess)
|
||||
return SCSI_TRANSPORTID_PROTOCOLID_FCP2;
|
||||
|
||||
id = kzalloc(sizeof(*id), GFP_KERNEL);
|
||||
id = kzalloc_obj(*id);
|
||||
if (!id)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user