lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150520070418.GA28946@jci-VirtualBox>
Date:	Wed, 20 May 2015 07:04:27 +0000
From:	"Dumbre, Nitesh Dilip (N.)" <ndumbre@...teon.com>
To:	"oleg.drokin@...el.com" <oleg.drokin@...el.com>,
	"andreas.dilger@...el.com" <andreas.dilger@...el.com>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"Julia.Lawall@...6.fr" <Julia.Lawall@...6.fr>,
	"joe@...ches.com" <joe@...ches.com>,
	"gdonald@...il.com" <gdonald@...il.com>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"rickard_strandqvist@...ctrumdigital.se" 
	<rickard_strandqvist@...ctrumdigital.se>,
	"uja.ornl@...il.com" <uja.ornl@...il.com>,
	"john.hammond@...el.com" <john.hammond@...el.com>,
	"HPDD-discuss@...ts.01.org" <HPDD-discuss@...ts.01.org>,
	"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] staging: Replace kzalloc and memcpy by kmemdup

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

Signed-off-by: Nitesh Dumbre <ndumbre@...teon.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
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ