Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp901794imu; Thu, 22 Nov 2018 07:05:12 -0800 (PST) X-Google-Smtp-Source: AFSGD/VTWh7uPC9AEhgfSKUU/rkyY5kO+4SCYAvdX5cUfhqRvoWywXATj9A18XZKcvDG0KeCIj1l X-Received: by 2002:a62:2c4d:: with SMTP id s74mr9555350pfs.6.1542899112253; Thu, 22 Nov 2018 07:05:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542899112; cv=none; d=google.com; s=arc-20160816; b=gM+9LoC7aw4nBOeaatwNlob3UNUySKfqdkolO23+zb02qOSOUUnXdkcXWe+q5Pp4Kg juQIzzDwlxpkYOje8Orz7h/pDlziEhFwH3ZT+p1qMnCACCvgq8tMtCQNKU6xXPHLkhCB 1zyEDnVbA+gC5bUymZ0jXNm8gcI5PqGr5dR+TKkvCYsBEktgFqGoXhCIIEq2Vin96mxK jy58/+cDRC5Q3M3LBDkn0nn8aIiUky82mtd6c7AMlbE+nSfHqZhHRRlzcn9JnxJcBQfX 7meYSCa2N8lUbzaV2Owgbo6xVIUmvWBYD/y1rjHMI6kJ+jtnx0dBWGi6qxpgXSfQwEoE Rkpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from :dkim-signature; bh=fAshg5hnRoROfJ4sR56Svjjp16WDuq8l8inCytpfi0A=; b=CZ9lq8t0Q6YKwLNcnkpxmgChzmPTdSw+8OZfBQ4oRTdN8LvyRWy6SrKznmfx8OLbYq vVESaorhlMfo0QEUsXSz3sPpei0hE9hk1DSo+Pp3i51bgThaUo9Ie9gLA/qyuqjoWBMv Qhma3zebrxIQyi9veA/gt8JXdgQsvRmMml+naS9IaZb94Cbsh3zuB3NtYZXI9lBpw+rL Y9OkybYDJQCyNkXFPSdJxpCFwaaQATuAyxyN6JYRgXDmqVF/3uOEzN2XmuxtgrmoD+U9 jdA3zQZDmL45G8pXroSVJDkhZ1uEQvhK+/y7663mPG29fsAjeC35wG5mCHHuNOGBP8RV G6mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=FZlYu0ql; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w185si48247148pgd.518.2018.11.22.07.04.56; Thu, 22 Nov 2018 07:05:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=FZlYu0ql; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731077AbeKVMoy (ORCPT + 99 others); Thu, 22 Nov 2018 07:44:54 -0500 Received: from m12-11.163.com ([220.181.12.11]:54006 "EHLO m12-11.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728243AbeKVMoy (ORCPT ); Thu, 22 Nov 2018 07:44:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=fAshg5hnRoROfJ4sR5 6Svjjp16WDuq8l8inCytpfi0A=; b=FZlYu0qlqImItoWuUZJuTRix6fF1olA0mn Xdf4jlcywG3QvwItjFFQC78bU/cC/liMsKdGmyf6FyAKqqvN6P7nIu/U+HrWS8Bz dauyF2qktESfWWSAYotCarSZci7f4mLHo1+ueum+1F3YkL4q96gi9vCbdh2fPtly kR/vyVKRM= Received: from bp.localdomain (unknown [106.120.213.96]) by smtp7 (Coremail) with SMTP id C8CowABHl2NMD_Zbya5UBQ--.15401S3; Thu, 22 Nov 2018 10:07:11 +0800 (CST) From: Pan Bian To: Boris Ostrovsky , Juergen Gross , Stefano Stabellini , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Subject: [PATCH] pvcalls-front: fixes incorrect error handling Date: Thu, 22 Nov 2018 10:07:12 +0800 Message-Id: <1542852432-30019-1-git-send-email-bianpan2016@163.com> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: C8CowABHl2NMD_Zbya5UBQ--.15401S3 X-Coremail-Antispam: 1Uf129KBjvdXoWrur48Kw18tF4fCFWkurWfZrb_yoWfZrg_CF 4Uuwn7Wr4qqFWDW3Wjy39xZFyFkFn0qF1fXFsF93y3AFyxAr4DZrZ2qws5Grs3WrW0ya43 Kr4UZr1Ikw1xtjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU5I0PDUUUUU== X-Originating-IP: [106.120.213.96] X-CM-SenderInfo: held01tdqsiiqw6rljoofrz/xtbBUQ8HclaD0Q1x-wAAss Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kfree() is incorrectly used to release the pages allocated by __get_free_page() and __get_free_pages(). Use the matching deallocators i.e., free_page() and free_pages(), respectively. Signed-off-by: Pan Bian --- drivers/xen/pvcalls-front.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c index 2f11ca7..77224d8 100644 --- a/drivers/xen/pvcalls-front.c +++ b/drivers/xen/pvcalls-front.c @@ -385,8 +385,8 @@ static int create_active(struct sock_mapping *map, int *evtchn) out_error: if (*evtchn >= 0) xenbus_free_evtchn(pvcalls_front_dev, *evtchn); - kfree(map->active.data.in); - kfree(map->active.ring); + free_pages((unsigned long)map->active.data.in, PVCALLS_RING_ORDER); + free_page((unsigned long)map->active.ring); return ret; } -- 2.7.4