mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: Replace kzalloc and memcpy by kmemdup
@ 2015-05-20  7:04 Dumbre, Nitesh Dilip (N.)
  2015-05-20  7:54 ` Drokin, Oleg
  2015-05-31  2:35 ` gregkh
  0 siblings, 2 replies; 5+ messages in thread
From: Dumbre, Nitesh Dilip (N.) @ 2015-05-20  7:04 UTC (permalink / raw)
  To: oleg.drokin, andreas.dilger, gregkh, Julia.Lawall, joe, gdonald,
	akpm, rickard_strandqvist, uja.ornl, john.hammond,
	HPDD-discuss@lists.01.org, devel, linux-kernel

This patch was generated by coccicheck and replaces kzalloc followed
by memcpy with kmemdup

Signed-off-by: Nitesh Dumbre <ndumbre@visteon.com>

diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index 57c6ddd..c988be4 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1711,13 +1711,12 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
 		goto destroy_new;
 	}
 	/* not found - create */
-	buffer = kzalloc(LNET_NIDSTR_SIZE, GFP_NOFS);
+	buffer = kmemdup(libcfs_nid2str(*nid), LNET_NIDSTR_SIZE, GFP_NOFS);
 	if (buffer == NULL) {
 		rc = -ENOMEM;
 		goto destroy_new;
 	}
 
-	memcpy(buffer, libcfs_nid2str(*nid), LNET_NIDSTR_SIZE);
 	new_stat->nid_proc = lprocfs_register(buffer,
 					      obd->obd_proc_exports_entry,
 					      NULL, NULL);
-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-05-31 21:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-20  7:04 [PATCH] staging: Replace kzalloc and memcpy by kmemdup Dumbre, Nitesh Dilip (N.)
2015-05-20  7:54 ` Drokin, Oleg
2015-05-31  2:35 ` gregkh
2015-05-31 13:13   ` Joe Perches
2015-05-31 20:56     ` gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome