From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.lixom.net (lixom.net [66.141.50.11]) by ozlabs.org (Postfix) with ESMTP id D12E7DDF83 for ; Thu, 23 Aug 2007 01:08:05 +1000 (EST) Date: Wed, 22 Aug 2007 09:12:55 -0500 From: Olof Johansson To: jgarzik@pobox.com Subject: [PATCH] [04/10] pasemi_mac: Fix memcpy amount for short receives Message-ID: <20070822141255.GE16830@lixom.net> References: <20070817205413.548020000@lixom.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Fix up memcpy for short receives. Signed-off-by: Olof Johansson Index: mainline/drivers/net/pasemi_mac.c =================================================================== --- mainline.orig/drivers/net/pasemi_mac.c +++ mainline/drivers/net/pasemi_mac.c @@ -516,9 +516,7 @@ static int pasemi_mac_clean_rx(struct pa netdev_alloc_skb(mac->netdev, len + NET_IP_ALIGN); if (new_skb) { skb_reserve(new_skb, NET_IP_ALIGN); - memcpy(new_skb->data - NET_IP_ALIGN, - skb->data - NET_IP_ALIGN, - len + NET_IP_ALIGN); + memcpy(new_skb->data, skb->data, len); /* save the skb in buffer_info as good */ skb = new_skb; } -- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olof Johansson Subject: [PATCH] [04/10] pasemi_mac: Fix memcpy amount for short receives Date: Wed, 22 Aug 2007 09:12:55 -0500 Message-ID: <20070822141255.GE16830@lixom.net> References: <20070817205413.548020000@lixom.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, linuxppc-dev@ozlabs.org To: jgarzik@pobox.com Return-path: Content-Disposition: inline; filename=pasemi_mac-bugfix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+glppd-linuxppc64-dev=m.gmane.org@ozlabs.org Errors-To: linuxppc-dev-bounces+glppd-linuxppc64-dev=m.gmane.org@ozlabs.org List-Id: netdev.vger.kernel.org Fix up memcpy for short receives. Signed-off-by: Olof Johansson Index: mainline/drivers/net/pasemi_mac.c =================================================================== --- mainline.orig/drivers/net/pasemi_mac.c +++ mainline/drivers/net/pasemi_mac.c @@ -516,9 +516,7 @@ static int pasemi_mac_clean_rx(struct pa netdev_alloc_skb(mac->netdev, len + NET_IP_ALIGN); if (new_skb) { skb_reserve(new_skb, NET_IP_ALIGN); - memcpy(new_skb->data - NET_IP_ALIGN, - skb->data - NET_IP_ALIGN, - len + NET_IP_ALIGN); + memcpy(new_skb->data, skb->data, len); /* save the skb in buffer_info as good */ skb = new_skb; } --