Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752856AbbETHU0 (ORCPT ); Wed, 20 May 2015 03:20:26 -0400 Received: from mail-db3on0117.outbound.protection.outlook.com ([157.55.234.117]:19276 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752210AbbETHUY convert rfc822-to-8bit (ORCPT ); Wed, 20 May 2015 03:20:24 -0400 X-Greylist: delayed 952 seconds by postgrey-1.27 at vger.kernel.org; Wed, 20 May 2015 03:20:23 EDT From: "Dumbre, Nitesh Dilip (N.)" To: "oleg.drokin@intel.com" , "andreas.dilger@intel.com" , "gregkh@linuxfoundation.org" , "Julia.Lawall@lip6.fr" , "joe@perches.com" , "gdonald@gmail.com" , "akpm@linux-foundation.org" , "rickard_strandqvist@spectrumdigital.se" , "uja.ornl@gmail.com" , "john.hammond@intel.com" , "HPDD-discuss@lists.01.org" , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] staging: Replace kzalloc and memcpy by kmemdup Thread-Topic: [PATCH] staging: Replace kzalloc and memcpy by kmemdup Thread-Index: AQHQkss1pMv2vFXO2k24i0vENa2Jug== Date: Wed, 20 May 2015 07:04:27 +0000 Message-ID: <20150520070418.GA28946@jci-VirtualBox> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=ndumbre@visteon.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [198.36.94.34] x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR06MB1273; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:HE1PR06MB1273;BCL:0;PCL:0;RULEID:;SRVR:HE1PR06MB1273; x-forefront-prvs: 0582641F53 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(189002)(199003)(87936001)(68736005)(2201001)(122556002)(40100003)(92566002)(2656002)(46102003)(2860100001)(2900100001)(5001830100001)(5001770100001)(102836002)(5001860100001)(229853001)(189998001)(33716001)(5001960100002)(107886002)(106356001)(106116001)(105586002)(33656002)(64706001)(101416001)(86362001)(50986999)(54356999)(66066001)(62966003)(77156002)(97736004)(2501003)(81156007)(4001540100001)(19580395003)(19580405001)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR06MB1273;H:HE1PR06MB1273.eurprd06.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-ID: <1C34F8426F6FE544B00D027CD62CF55B@eurprd06.prod.outlook.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: visteon.com X-MS-Exchange-CrossTenant-originalarrivaltime: 20 May 2015 07:04:27.1147 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7a147aaf-01ec-498c-80a1-e34a8c63c548 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR06MB1273 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1193 Lines: 31 This patch was generated by coccicheck and replaces kzalloc followed by memcpy with kmemdup Signed-off-by: Nitesh Dumbre 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/