linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dumbre, Nitesh Dilip (N.)" <ndumbre@visteon.com>
To: "oleg.drokin@intel.com" <oleg.drokin@intel.com>,
	"andreas.dilger@intel.com" <andreas.dilger@intel.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"Julia.Lawall@lip6.fr" <Julia.Lawall@lip6.fr>,
	"joe@perches.com" <joe@perches.com>,
	"gdonald@gmail.com" <gdonald@gmail.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"rickard_strandqvist@spectrumdigital.se" 
	<rickard_strandqvist@spectrumdigital.se>,
	"uja.ornl@gmail.com" <uja.ornl@gmail.com>,
	"john.hammond@intel.com" <john.hammond@intel.com>,
	"HPDD-discuss@lists.01.org" <HPDD-discuss@ml01.01.org>,
	"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] staging: Replace kzalloc and memcpy by kmemdup
Date: Wed, 20 May 2015 07:04:27 +0000	[thread overview]
Message-ID: <20150520070418.GA28946@jci-VirtualBox> (raw)

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

             reply	other threads:[~2015-05-20  7:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-20  7:04 Dumbre, Nitesh Dilip (N.) [this message]
2015-05-20  7:54 ` [PATCH] staging: Replace kzalloc and memcpy by kmemdup Drokin, Oleg
2015-05-31  2:35 ` gregkh
2015-05-31 13:13   ` Joe Perches
2015-05-31 20:56     ` gregkh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150520070418.GA28946@jci-VirtualBox \
    --to=ndumbre@visteon.com \
    --cc=HPDD-discuss@ml01.01.org \
    --cc=Julia.Lawall@lip6.fr \
    --cc=akpm@linux-foundation.org \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gdonald@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=john.hammond@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg.drokin@intel.com \
    --cc=rickard_strandqvist@spectrumdigital.se \
    --cc=uja.ornl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).