Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422652AbbHGIAm (ORCPT ); Fri, 7 Aug 2015 04:00:42 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:25476 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422631AbbHGIAj (ORCPT ); Fri, 7 Aug 2015 04:00:39 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-85-55c465a5ad21 From: Andrzej Hajda To: Derek Chickles , Satanand Burla , Felix Manlunas , Raghu Vatsavayi , Sunil Goutham , Robert Richter Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 16/31] net/cavium/liquidio: use kmemdup rather than duplicating its implementation Date: Fri, 07 Aug 2015 09:59:22 +0200 Message-id: <1438934377-4922-17-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1438934377-4922-1-git-send-email-a.hajda@samsung.com> References: <1438934377-4922-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrILMWRmVeSWpSXmKPExsVy+t/xK7pLU4+EGjzs17a4te4cq8XGGetZ LRZ9+MhssbTxF7vFpsfXWC0u75rDZrH2yF12i2MLxCyubD3OYnFw1UYmiy/b97NZXL78g9mB x2PG70UsHhtO9LN6bFrVyeaxeUm9R9+WVYwenzfJBbBFcdmkpOZklqUW6dslcGXc2LSDuWAp R8Xpd1PYGhgnsncxcnJICJhIHH75GMoWk7hwbz1bFyMXh5DAUkaJfxf/QjlNTBIfdp5mAqli E9CU+Lv5JlhCRGAJk8TDn8dZQBxmgTeMEnunnwByODiEBVIk/vYqgjSwCKhKLNr6EayZV8BZ YubxY6wQ6+QkTh6bDGZzAsVXds8Es4UEnCTe9F1gnsDIu4CRYRWjaGppckFxUnquoV5xYm5x aV66XnJ+7iZGSEB+2cG4+JjVIUYBDkYlHt6Ef4dDhVgTy4orcw8xSnAwK4nwPtQHCvGmJFZW pRblxxeV5qQWH2KU5mBREuedu+t9iJBAemJJanZqakFqEUyWiYNTqoGxdanJr5DMqtevbpYk KP6N/NY3QzTIosXs6uGcK3vO2l1Pzl88c5rVhb8ZyttDGMR78kWjH2XPa7Ys2HT/gH7cwQ9V bKc7Qo8qmHT6NX2TDp7wa6W4YbKhuaHCkn0qR63l152t++Dg0xjBb+3RlV71Sb/wcnDVDL1d LroG1kYtR93bmXde1lFiKc5INNRiLipOBAAUwwD0RAIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1275 Lines: 36 The patch was generated using fixed coccinelle semantic patch scripts/coccinelle/api/memdup.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320 Signed-off-by: Andrzej Hajda --- drivers/net/ethernet/cavium/liquidio/octeon_device.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_device.c b/drivers/net/ethernet/cavium/liquidio/octeon_device.c index f67641a..8e23e3f 100644 --- a/drivers/net/ethernet/cavium/liquidio/octeon_device.c +++ b/drivers/net/ethernet/cavium/liquidio/octeon_device.c @@ -602,12 +602,10 @@ int octeon_download_firmware(struct octeon_device *oct, const u8 *data, snprintf(oct->fw_info.liquidio_firmware_version, 32, "LIQUIDIO: %s", h->version); - buffer = kmalloc(size, GFP_KERNEL); + buffer = kmemdup(data, size, GFP_KERNEL); if (!buffer) return -ENOMEM; - memcpy(buffer, data, size); - p = buffer + sizeof(struct octeon_firmware_file_header); /* load all images */ -- 1.9.1 -- 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/