Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp682984ybi; Wed, 17 Jul 2019 03:15:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8h5zCUr7pIDdzWIHlOLwiWxqG9WHAS0dMZMRS+cYc6nfsiICwFI3OLdSBiw3FkETNSlGr X-Received: by 2002:a63:5945:: with SMTP id j5mr39965005pgm.452.1563358558856; Wed, 17 Jul 2019 03:15:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563358558; cv=none; d=google.com; s=arc-20160816; b=L4BHoDJyMWtxFrcdtFMvUyxGbuiCQ6DJ2OjOwmXV3CIDqxlzGaRPfBVRkH0i7sWEcM OV+Tz2qD9LzFyLbqpuoklvUSTjX7yBdx7egGrNYT+5je5gXqQ2wn6JXB9gO/EXTZpyWJ j/onwm4v1XW2BWVoynJfQeDdcIgx89YlLEF1LnyvjPV7KbLNCZ573PFfi3rbcuJx4kQV /L5VdjnIOJR3pZMa2gwiBQIls6JsJhuktpqD/pVNaO+ErAbAV5nU/MyUVsX5snKPPOhE eBlZTR1ORVVFmlZY+nI1J0aQ/34vALJVgZ84Hj5sVZWYTg1cecPd3Oer2ir5QNo5F9U0 dB+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=/BlyQx1CQtUbdljXgzQOEsVnyderN3F/tQOkowCKWUQ=; b=XsYWmjHfkHbvRg8GaJBHQJpaseaEE1kRGUx29O6++jpcBEN4PYkC1Oc/W7bDV+7nLw sJRxcUuu7qHKCMd71oWJYvimX0Pbpt/aQGsYzKOiCPhET0UMDRx52dSYwDRTfPKwWvwg WHI0MP6v1TI1AvTAvy2iug14VvnA6VgP5LtZf00YCeDUcw6SJHJABKt+a1Zq8pncCR8G 10nFm1eeVjwrj9FZlBVpWnC3XWy5WkJe7USanfpTk3TSg1Ks2BEE150jl8vHMXzVz2xK uos/FSXO2fxFzuo75seJu4QkGm1hq1rvFrU6Qayci3OGSAy8vTSe8wEE9m0xtfDaKzvd 0uLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=uoi9pWh5; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4si24276562pgo.198.2019.07.17.03.15.43; Wed, 17 Jul 2019 03:15:58 -0700 (PDT) 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=fail header.i=@gmail.com header.s=20161025 header.b=uoi9pWh5; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729570AbfGQKPI (ORCPT + 99 others); Wed, 17 Jul 2019 06:15:08 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:37905 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725893AbfGQKPH (ORCPT ); Wed, 17 Jul 2019 06:15:07 -0400 Received: by mail-pf1-f193.google.com with SMTP id y15so10613476pfn.5; Wed, 17 Jul 2019 03:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/BlyQx1CQtUbdljXgzQOEsVnyderN3F/tQOkowCKWUQ=; b=uoi9pWh55AGnrKz9wQDRxTJfvIcPJinWznMSgdB5DGm0cknbCFwgPfFWhOgEBvElB1 i42m9r0OGAkelxiCQIDlL2hp8hEEbbwm7bJuLiOfGmCFnbS+CJLgZT3QqwJN03CR+tlq boLrhs+XrkOS7ixrKkFOx/vnbD7ifqx89CuacC4xpnWIiPMy7vh6A5WUl6okNbV2aKwy SPJXLBlDmdFOHyx5KUGKMbKXFgUAcCtQ9LPts0uvw/XkethOsOVq2pYj2Hxi4ZmfJb4g hcHrqIY1ha1gkQEHhic27MeMZ2i/yqU6iYUAJ2B2tEO+V0De9vSOur7AzRsSfTqyOt7V 6xxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/BlyQx1CQtUbdljXgzQOEsVnyderN3F/tQOkowCKWUQ=; b=qtRq3PT8xGPcG/nGfaVEDnNSMsb4yyaiEpiBpG3iviV4z5WRwAI8eLWiH4sQdQaDER EDLUh9SbIe2YsFwKuDQevkhqruaO/kq3I2T2YaqRlP4ud75O86Jp0T32QqAdrulDsFor FjKMQTrT22wuiIUP8uSHWwY+ANVBqFbf4BOPPgeaYBh7OkRUQ0uwCQA74V53A177s74Z Ma5MHFakAFZ5dcNvSTNorP0AtSpzRmgk68SmXv/6o+8Ygl1Ja2iEc7rKUooGJmigDjJz 16zo2YNcFUlPGfHzGgpKZWzbHC42tioKTyDRIfeuXV26h65blsyLqyPAymXjFa5OTqvf FpYA== X-Gm-Message-State: APjAAAUppw0CWyrxIN8Cy2E1bo0lZZz6+Bn8hahIiNmweee48aGQctxa 16jG0bUSr/Gslcgo8YIamgM= X-Received: by 2002:a63:9318:: with SMTP id b24mr30103146pge.31.1563358507047; Wed, 17 Jul 2019 03:15:07 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.gmail.com with ESMTPSA id q198sm23342176pfq.155.2019.07.17.03.15.04 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 17 Jul 2019 03:15:06 -0700 (PDT) From: Chuhong Yuan Cc: Saeed Mahameed , Leon Romanovsky , "David S . Miller" , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH v2] net/mlx5: Replace kfree with kvfree Date: Wed, 17 Jul 2019 18:14:57 +0800 Message-Id: <20190717101456.17401-1-hslester96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Variable allocated by kvmalloc should not be freed by kfree. Because it may be allocated by vmalloc. So replace kfree with kvfree here. Fixes: 9b1f298236057 ("net/mlx5: Add support for FW fatal reporter dump") Signed-off-by: Chuhong Yuan --- Changes in v2: - Add corresponding Fixes tag drivers/net/ethernet/mellanox/mlx5/core/health.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c b/drivers/net/ethernet/mellanox/mlx5/core/health.c index 2fe6923f7ce0..9314777d99e3 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/health.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c @@ -597,7 +597,7 @@ mlx5_fw_fatal_reporter_dump(struct devlink_health_reporter *reporter, err = devlink_fmsg_arr_pair_nest_end(fmsg); free_data: - kfree(cr_data); + kvfree(cr_data); return err; } -- 2.20.1