From patchwork Tue Dec 16 20:58:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 422087 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D6B881400DD for ; Wed, 17 Dec 2014 07:59:29 +1100 (AEDT) Received: from localhost ([::1]:46837 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0zDM-000321-62 for incoming@patchwork.ozlabs.org; Tue, 16 Dec 2014 15:59:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0zD2-0002b3-9E for qemu-devel@nongnu.org; Tue, 16 Dec 2014 15:59:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0zCs-0004yy-1d for qemu-devel@nongnu.org; Tue, 16 Dec 2014 15:59:08 -0500 Received: from mail-pa0-x234.google.com ([2607:f8b0:400e:c03::234]:34396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0zCr-0004yh-RX; Tue, 16 Dec 2014 15:58:57 -0500 Received: by mail-pa0-f52.google.com with SMTP id eu11so14837026pac.11 for ; Tue, 16 Dec 2014 12:58:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=ywo67hG7H+4KWA9M0ZSu0MldVsVluNGUTLWXLgyzdpA=; b=nf1qzLRKOe16avEue8GfDC07iMbfqFTwpugsxKqMxuZLmJIOAzipDgdizyKHnJudy2 bIHyyrJnet0n0TzWfPswWwK5SC208K3Tz/fyE8aeP7LHxa5JMXY8lOrGcXdQ71LK3Pxw uWvHRo8anOUFt0jKjbyZxU2B2zqEYivmr8Lt8auMxOoT1SM8M70FsSba1kOJQFeVSGHB XkDEvOGlC3wepzafS7yfUAkIh/Pzjnr86ATf7jz0L8l4rrFS5mOZhJ2r2ce2Naz3B9+7 Q47+DbqZYhmR1P96B1WBFkV5JZBHHjl0ey8jmb0pFVs1NQE4BAI74AlmawLNxbDZV93t 6i6w== X-Received: by 10.70.123.97 with SMTP id lz1mr28699017pdb.150.1418763536909; Tue, 16 Dec 2014 12:58:56 -0800 (PST) Received: from [192.168.1.103] ([223.72.65.78]) by mx.google.com with ESMTPSA id nv7sm1847956pbc.29.2014.12.16.12.58.54 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 16 Dec 2014 12:58:55 -0800 (PST) Message-ID: <54909D02.2030404@gmail.com> Date: Wed, 17 Dec 2014 04:58:42 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: qemu-devel , QEMU Trivial X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::234 Subject: [Qemu-devel] [PATCH] hw/net/xen_nic.c: Set 'netdev->mac' to NULL after free it X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Since net_init() checks whether 'netdev->mac' is NULL, before alloc it; net_release() also need set 'netdev->mac' to NULL after free it. Signed-off-by: Chen Gang --- hw/net/xen_nic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c index 8eaa77b..19ecfc4 100644 --- a/hw/net/xen_nic.c +++ b/hw/net/xen_nic.c @@ -428,6 +428,7 @@ static int net_free(struct XenDevice *xendev) netdev->nic = NULL; } g_free(netdev->mac); + netdev->mac = NULL; return 0; }